Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Invalid Operation on projection with "as" operator

$
0
0
Hello Paul,

Can you work around this issue by calling .ToList() first and then projecting the result however you want?
If this is the complete query that you have you are already selecting all attributes for the result so with or without the projection you will load the same columns and rows of data.
Here is what I mean:
01.var query = from t in context.GetAll<Teacher>()
02.            where t.Id == id
03.            select t;
04.var rawResult = query.ToList();
05.var result = rawResult.Select(t => new
06.            {
07.                Teacher = t,
08.                Person = t as Person
09.            }).ToList();

If you cannot apply the work around for some reason do not hesitate to contact us.

Regards,
Viktor Zhivkov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 

Viewing all articles
Browse latest Browse all 94857

Trending Articles