我有ac#课
public class VendorLocation
{
public string VendorCode { get; set; }
public string Location { get; set; }
}
和一个列表
var lstVendorLocation = new List<VendorLocation>();
以下 LINQ 查询被编译并在运行时引发异常:
var query = from s in DB.Sales
where lstVendorLocation.Any(vendorLoc => s.VendorCode.Equals(lstVendorLoc.VendorCode) && s.Location.Equals(lstVendorLoc.Location))
select s;`
异常消息是:
无法处理类型'匿名类型,因为它没有已知的值层映射