我繼承了一些LINQ,我想將它重寫爲非LINQ C#,這樣我就可以計算出哪個位失敗了。解碼LINQ的服務?
(我已下令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#嗎?
FWIW,您可以在需要許可證密鑰才能繼續工作之前下載ReSharper的將30個工作日內的試用版。 – STLDeveloper
我做了並且過期了 – cja
您可能嘗試的其他一些事情是跟蹤正在執行的實際查詢,也許使用LINQPad來協助翻譯LINQ代碼。 – STLDeveloper