Cannot Translate to SQL using Select(x => Func(x))
- by Dan
I'm slowly learning the ins and outs of LINQtoSQL, but this is confusing me.
Here is the statement I have:
IQueryable<IEvent> events = (from e in db.getEvents()
select e).Select(x => SelectEvent(x, null));
What the SelectEvent does can be explained in this answer here. I am not using the .toList() function as I don't want potentially thousands of records brought into memory.
public IEvent SelectEvent(SqlServer.Event ev, EventType? type) {
// Create an object which implements IEvent
// I don't have the code in front of me, so forgive the lack of code
}
My question is really for the Select() method. I get the "Cannot translate to SQL" error and the Select() is listed in the error message.
Clueless on this one :-/.