public async Task AddMany(List <Tabla> entityList) { var data = new DataDummy(); var table = data.DummyTable(entityList); using (var connection = Connection) { //connection.Open(); await connection.ExecuteAsync("usp_InsertTvp", new { Records = table.AsTableValuedParameter("TvpRecords") }, commandType : CommandType.StoredProcedure); } }
public async Task AddMany(List <Tabla> entityList) { var data = new DataDummy(); var table = data.DummyTable(entityList); var param = new SqlParameter("@Records", table) { TypeName = "TvpRecords", SqlDbType = SqlDbType.Structured }; await _context.Database.ExecuteSqlRawAsync("exec usp_InsertTvp @Records", param); }