Answer the question
In order to leave comments, you need to log in
IQueryable vs Specification + Repository
Hello. There is a common-sense opinion that IQueryable doesn't violate LSP so badly: blog.ploeh.dk/2012/03/26/IQueryableTisTightCoupling/ . Indeed, the only linq provider that will "digest" any condition is an in-memory implementation, which contradicts the very meaning of the interface as a translator.
At the same time, I like Repository and Specification even less: blog.byndyu.ru/2011/08/repository.html .
And everything would be fine in QueryObject if I didn't consider that
public class FindAccountByEmailQuery
{
private readonly ILinqProvider linqProvider;
private string email;
public FindAccountByEmailQuery(ILinqProvider linqProvider, string email)
{
this.linqProvider = linqProvider;
this.email = email;
}
public Account Execute()
{
return linq.Query()
.Where(x => x.Email == email)
.SingleOrDefault();
}
}
.Where(x => x.Email == email)
.SingleOrDefault();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question