我继承了一些 LINQ,我想将它重写为非 LINQ C#,这样我就可以确定哪个位失败了。
(我已经订购了 ReSharper,但 JetBrains 的许可证密钥似乎很慢。)
LINQ 是
var accounts = from a in srvContext.CreateQuery<Incident>()
join b in srvContext.CreateQuery<integ_benefitallowances>() on a.integ_BenefitId.Id equals b.integ_benefitallowancesId.Value
where b.integ_BenefitId.Id == _currentIncident.integ_BenefitId.Id
where a.Integ_DependantId.Id == a.Integ_DependantId.Id
where a.integ_ClaimStatus.Value == 0 || a.integ_ClaimStatus.Value == 2
where a.Integ_DateofClaim.Value > timePeriod
select new Incident
{
LogicalName = a.LogicalName
};
错误是
System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: There was an error with this process
variable '<>h__TransparentIdentifier2' of type '<>f__AnonymousType0`2[PaycareCRM.Incident,PaycareCRM.integ_benefitallowances]' referenced from scope '', but it is not defined
是否有网站或简单的工具可以为我将 LINQ 转换为普通的 C#?