Uint(i_Customer)をNullable Int(i_Customer)IDに変換しようとしています.Null値を受け入れていて、他のIDがサポートしていないためです。 親テーブルはCustomer(i_Customer)で、ChildはFault(i_customer)です。どちらも、結果を得るためにEF Queryに参加しています。しかし、非常に混乱しているnullreferenceexception was unhandled by user code
例外があります。どうすれば修正できますか?ここでHoがEFクエリでNintable IntにNintable Intを変換する
はEFクエリです:
if (servicelevel == 3)
{
result = (from s in res
join cInfo in custInfo on
s.fault.i_customer equals Convert.ToInt32((int?)cInfo.customers.i_Customer)
where (s.fault.resolved == null) || (s.tasks.assignedto == agent)
orderby s.fault.ispriority descending, s.fault.logtime ascending
select new ActiveFaultResult()
{ Company_Name = cInfo.customers.Company_Name,
//replies = replies,
idFaults = s.fault.idFaults,
hashvalue = s.fault.hashvalue,
responsible = s.fault.responsible,
logtime = s.fault.logtime,
isinternal = s.fault.isinternal,
ispriority = s.fault.ispriority
}).ToList<ActiveFaultResult>();
// var limitresult = result.Take(50);
return result;
}
を試してみてください? ? – mybirthname
@mybirthname、これを定義してEFクエリで使用することは可能でしょうか?もしそうなら、どうですか?手伝ってください。 –
Convert.ToInt32((int?)cInfo.customers.i_Customer)=>(int?)cInfo.customers.i_Customer –