I have a generic repository and I realized that it is taking a long time to return a query with the selection of some columns of my database, the Query () method is as follows:
public IList<T> Query(System.Linq.Expressions.Expression<Func<T, bool>> Where)
{
return Entity.AsExpandable().Where(Where).AsQueryable<T>().AsNoTracking<T>().ToList();
}
If you look at the end I still use Take (10), but analyzing the code, has a field called 'source' which shows 17822 records, so regardless of selecting 10 or 1000, it seems to me that it is always bringing all the record, follow image:
My question is if I have some configuration of the entity to always have this behavior or the call of my query is wrong?
Thank you
Léo