Closed
Description
What do you think of offering extra overloads for Fetch methods that use AsNoTracking in order to improve performance?
public virtual IQueryable<T> FetchWithNoTracking(Expression<Func<T, bool>> predicate)
{
return Table.AsNoTracking().Where(predicate);
}
Indeed in order to help devs to don't forget to use the most most optimal one I would use:
public virtual IQueryable<T> Fetch(Expression<Func<T, bool>> predicate)
{
return Table.AsNoTracking().Where(predicate);
}
public virtual IQueryable<T> FetchWithTracking(Expression<Func<T, bool>> predicate) {
return Table.Where(predicate);
}
Problem is it is a breaking change, so to avoid unnoticed bad uses of the Fech method maybe it will be better to remove Fech method and only have FetchWithTracking and FetchWithNoTracking methods.
What do you think?
Activity