Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 4.0 使用EntityFramework.Extended进行批更新_C# 4.0_Entity Framework 4_Entity Framework Extended - Fatal编程技术网

C# 4.0 使用EntityFramework.Extended进行批更新

C# 4.0 使用EntityFramework.Extended进行批更新,c#-4.0,entity-framework-4,entity-framework-extended,C# 4.0,Entity Framework 4,Entity Framework Extended,我正在尝试使用Entity framework extended使用批处理更新,但我不确定如何做到这一点 到目前为止,我拥有以下代码: List<Guid> listIds = new List<Guid>(); listIds = listIds.Union(hem.ProductList.Where(x => x.CustListID == custListID).ToList().Select(y => y.OrderListID)).ToList(

我正在尝试使用Entity framework extended使用批处理更新,但我不确定如何做到这一点

到目前为止,我拥有以下代码:

List<Guid> listIds = new List<Guid>();


listIds = listIds.Union(hem.ProductList.Where(x => x.CustListID == custListID).ToList().Select(y => y.OrderListID)).ToList();

请告知我如何实现此目的。

您正在寻找以下语法:

db.ProductList.Update(x => listIds.Contains(x.OrderListID),
                           x => new ProductList { CustListID = custListID });

包含
在语句中被转换为SQL

您正在寻找以下语法:

db.ProductList.Update(x => listIds.Contains(x.OrderListID),
                           x => new ProductList { CustListID = custListID });

Contains
语句中转换为SQL

x=>x.OrderListID在ListId中的语法不正确。有什么办法吗?'in'不正确syntaxx=>x.ListId中的OrderListID语法不正确。有什么办法吗?'in'的语法不正确