This user story will enable the library to execute a statement that can pass a TVP (or DataTable object) in the execution. By default, if the value of the property of the passed parameter is DataTable, then the SqlParameter.TypeName must be automatically set based on the value of the DataTable.TableName.
// Setup
var table = CreateIdentityTableType();
using (var connection = new SqlConnection(Database.ConnectionStringForRepoDb))
{
// Act
var executeResult = connection.ExecuteQuery<IdentityTable>("sp_identity_table_type",
new { Table = table }).First();
// Act
var queryResult = connection.QueryAll("SELECT * FROM [sc].[IdentityTable];").First();
// Assert
Helper.AssertPropertiesEquality(executeResult, queryResult);
}
This user story will enable the library to execute a statement that can pass a TVP (or
DataTableobject) in the execution. By default, if the value of the property of the passed parameter isDataTable, then theSqlParameter.TypeNamemust be automatically set based on the value of theDataTable.TableName.