I have a query that executes over three different tables and I need to return the result as an Entities.
I started by creating a custom class to hold my result from the query
Then I created an IQueryable
method with the correct linq query to return the result.
Here a sample of the method :
var results = (from Summary
let details = Summary.parents.Where(o => o.id == Summary.id)
DataContext.Periods on Summary.periodid equals Period.periodid
where Summary.status == Status
&& Summary.Transdate >= Period.datef
&& Summary.Transdate <= Period.datet
period = Summary.periodid,
number = Summary.number,
dnumber = Summary.dnumber,
discriptor = Summary.discriptor,
transdate = Summary.transdate,
notes = Summary.notes
I complied & run the application, when I try to load the query I got an exception says:
Part of the exception:
Load operation failed for query 'Getsummery_View'. An exception occured during the execution of '
>.Select(Summary => new <>f__AnonymousType0`2(Summary = Summary,
What am I doing wrong, this was working fine with EF4.
Any help !!