Expose IQueryable Over WCF Service

You should check WCF Data Services which will allow you to define Linq query on the client. WCF Data Services are probably the only solution for your requirement. IQueryable is still only interface and the functionality depends on the type implementing the interface. You can’t directly expose Linq-To-Sql or Linq-To-Entities queries. There are multiple reasons … Read more

IQueryable & Repositories – take 2?

DDD Repository should encapsulate data access technicalities: Definition: A Repository is a mechanism for encapsulating storage, retrieval, and search behavior which emulates a collection of objects. It is also responsible for handling middle and end of life of domain objects. Repository interface belongs to Domain and should be based on Ubiquitous Language as much as … Read more

The provider for the source IQueryable doesn’t implement IAsyncQueryProvider

I get stuck on this issue today and this lib resolve it for me https://github.com/romantitov/MockQueryable completely, please refer: Mocking Entity Framework Core operations such ToListAsync, FirstOrDefaultAsync etc. //1 – create a List<T> with test items var users = new List<UserEntity>() { new UserEntity{LastName = “ExistLastName”, DateOfBirth = DateTime.Parse(“01/20/2012”)}, … }; //2 – build mock by … Read more

ASP.MVC: Repository that reflects IQueryable but not Linq to SQL, DDD How To question

Assuming that your LINQ to SQL (L2S) classes are auto-generated and reflects your underlying database, the short answer is: Don’t expose IQueryable of any of your L2S classes – it would be a Leaky Abstraction. The slightly longer answer: The whole point of Repositories is to hide data access behind an abstraction so that you … Read more