The full error that is shown is "System.NotSupportedException
HResult=0x80131515
Message=Specified method is not supported.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>"
It's a pretty complex query, and I don't really want to post the whole thing here, so I have simplified it as below
Code: Select all
IQueryable<ServiceResAvail> serviceResAvailFilter = sc.DB.ServiceResAvail.Where(p => p.AvailStartDateTime >= model.StartDate && p.AvailStartDateTime < model.StartDate.AddDays(1));
IQueryable<ServiceResAvail> serviceResAvailFilter = sc.DB.ServiceResAvail.Where(p => p.AvailStartDateTime >= model.StartDate && p.AvailStartDateTime < model.StartDate.AddDays(1));
var pickups = from sra in serviceResAvailFilter
from sr in sc.DB.ServiceResource.Where(p => p.PrimaryKey == sra.ResourceID)
...
select new RptResourceManifest()
{
ServiceId = sr.ServiceID,
...
};
var dropoffsSector = (from sra in serviceResAvailFilter
from sr in sc.DB.ServiceResource.Where(p => p.PrimaryKey == sra.ResourceID)
.....
select new RptResourceManifest()
{
ServiceId = sr.ServiceID,
....
}).Distinct();
var dropoffs = (from sra in serviceResAvailFilter
from sr in sc.DB.ServiceResource.Where(p => p.PrimaryKey == sra.ResourceID)
.....
select new RptResourceManifest()
{
ServiceId = sr.ServiceID,
.....
}).Distinct();
var pickupsAndDropOffs = pickups.Union(dropoffs).Union(dropoffsSector).ToList();