我有LINQ代碼,我收到以下錯誤:集合體System.ServiceModel.FaultException: The type 'ObjectMgmt' is not supported in aggregation operations.
LINQ錯誤的類型不是在聚合操作支持
(from cinnost in edc.CinnostSOPs
where cinnost.LegislativneVyznamna == true &&
cinnost.ObjektId == objektid
select (from o in edc.PlanRealizaces
where o.CinnostSOPIdSOP == cinnost.IdSOP &&
o.DatumPlatnosti <= DateTime.Now &&
o.Provest == true &&
o.DatumProvedeni == null
orderby o.DatumPlatnosti descending
select new ObjectMgmt
{
Datum = (DateTime.Now.Date - o.DatumPlatnosti.Value).TotalDays
}).Max(m => m)).ToList<ObjectMgmt>();
哇,查詢是完全無法辨認。你能自己讀這個代碼嗎? – usr