Amounts =
Context.Ppm_TblCodeType
.Where(bc => bc.OrganisationId == Contract.OrganisationId)
.Select(bc => new MacroPaymentValue
{
Code = bc.CodeTypeCode,
ShortName = bc.ShortDescription,
ValueForPayment = visits
.Where(v => v.Detail.CodeTypeCode == bc.CodeTypeCode)
.Sum(v => v.Detail.Charge != null ? v.Detail.Charge.Value : 0)
}).ToArray();
我遇到了异常:本地序列不能在查询运算符的 LINQ to SQL 实现中使用,但 Contains 运算符除外。
我猜这与 .Sum() 调用有关...如何修改它以避免异常?