Generate SQL text query from DbCommand. Can be used for unit test and integration test purposes.
$ dotnet add package Voyager.DbCommandSqlGenerate SQL text query from DbCommand. Can be used for unit test and integration test purposes.
There is added extension to the DbCommand class GetGeneratedQuery. This is an example of how to use:
using System.Data.Common;
[Test]
public void SimpleSelectParam()
{
var cmd = provider.CreateCommand();
...
string test = cmd.GetSql();
Assert.That(test, Is.EqualTo("SELECT * FROM dbo.Akwizytor WHERE IdAkwizytor='TESTAKWIZYTOR1'"));
}