I have the below call in my repository where I return IQueryable of Node (my business object class) then I have a filter function in my service layer which adds to the IQueryable call and filters the repository function GetNodes by id. When I return the FilterById as a list (so it executes) I get error -- The member bo.Node.Id has no supported translation to SQL. --
Is there a way to get around this error when returning a not linq generated class as IQueryable?
public IQueryable<bo.Node> GetNodes()
{
return (from item in Db.Nodes select new bo.Node(item.id,
item.created, item.lastupdated, item.name,
item.parentid, item.siteid, item.userid));
}
In my service layer
private IQueryable<bo.Node> FilterById(IQueryable<bo.Node> source, Guid id)
{
return source.Where(i => i.Id.Equals(id))
}