public class QueryProcessor
{
private readonly DbContext _context;
public QueryProcessor(DbContext context)
{
_context = context;
}
public IQueryable<T> Process<T>(Action<IQueryOption<T>> action) where T : class
{
var queryOption = new QueryOption<T>(_context.Set<T>().AsNoTracking());
action?.Invoke(queryOption);
return queryOption.Process();
}
}