ecengel
9/27/2018 - 2:56 AM

Query Processor V1

 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();
        }
    }