When executing stored procedure without return value but with a user-defined table type like this:
var dbStrings = new SqlParameter("@data", SqlDbType.Structured)
{
TypeName = new StringListType().Name,
Value = new StringListType().DataRecordsFrom(listOfStrings.Select(p => p.Value).ToList())
};
_dbContext.Database.ExecuteSqlCommand("exec [dbo].[InsertRecords] @SID, @filerType, @data", sid.ToString(), "Field", dbStrings);
I get an error
When executing a command, parameters must be exclusively database parameters or values
How can I execute stored procedure through DbContext with multiple input parameters (some UDTT)?