I m trying to track down a crash in some existing code in a web app I inherited.. I ve traced this down to a single LINQ expression:
var projInfo = (from v in context.TPM_PROJECTVERSION
join p in context.TPM_PROJECT on v.PROJECTID equals p.PROJECTID
join pto in context.TPM_USER on v.TPM_USER1.USERID equals pto.USERID
join pt in context.TPM_PROJECTTYPES on p.PROJECTTYPEID equals pt.PROJECTTYPEID
where v.PROJECTID == projectId && v.VERSIONID == versionId
select new
{
ProjectName = v.NAME,
ProjectType = pt.SHORTNAME,
ProjectDesc = v.DESCRIPTION,
BusinessLaunchData = p.BUSINESSLAUNCHDATE,
BusinessSponsor = (v.TPM_USER3.FIRSTNAME + " " + v.TPM_USER3.LASTNAME),
PrimaryTrainingOwner = (pto.FIRSTNAME + " " + pto.LASTNAME)
}).First();
错误是“数量不包括任何内容”,我已追查到这一行:
join pto in context.TPM_USER on v.TPM_USER1.USERID equals pto.USERID
如果美国电力局1 无效,则该行不会归还。 相反,我只需要掌握初级知识,而只是作废或空白。 基本上,我需要做的是教育、青年和体育部,并在确定初级人才时对此进行检查。 是否有办法更新该准则的表述,以处理这一问题? 感谢!