Click here to Skip to main content
15,891,670 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am creating a Repository that implements IQueryable. The client calls this Repository as follows:

OrderRepository.AsQueryable().Where(x => x.ID == 123);


So the point of IQueryable as I understand it is that is allows the implementor to access the expression being passed to it before fetching the data/entities.

For example, with the code above, OrderRepository would know to perform a specific fetch from it's datasource where ID=123.

Without AsQueryable the OrderRepository would need to fetch all orders and *then* the Where function would be applied by the client to filter the full Orders result set down to only those orders where ID=123.

My main problem right now is I seem to be having problems accessing the expression through the Repository.

Is my understanding of this correct? What might I be missing?
Posted

1 solution

http://stackoverflow.com/questions/1578778/using-iqueryable-with-linq[^]

This link should help answer some of your questions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900