Code like this:
var compIds = from p in packinglist.List select p.ComponentId; var components = from c in context.Components where compIds.Contains(c.Id) select c; foreach (var item in components) { item.CurrentSiteId = packinglist.DestinationId; } context.SaveChanges();
Finishes releasing a variety of SQL statements, such as
update [dbo].[Components] set [CurrentSiteId] = @0 where ([Id] = @1)
Is there a way to instruct EF (Code First) about the following:
update [dbo].[Components] set [CurrentSiteId] = @0 where ([Id] in (....))
Or should I learn to use one of the available SQLQuery methods or a standalone tool like Dapper or an array or ...?
source share