public async Task <QueryResult <Job> > GetJobsAsync(JobQuery queryObj) { var result = new QueryResult <Job>(); var query = _context.Jobs .Include(j => j.Country) .Include(j => j.State) .Include(j => j.EmploymentType) .Include(j => j.SalaryType) .Include(j => j.Category) .Include(j => j.JobBoard) .Include(j => j.Stat) .AsQueryable(); query = query.ApplyFiltering(queryObj); query = query.SortBasedOnListType(queryObj); var columnsMap = ColumnsMap.CreateColumnsMap(); query = query.ApplyOrdering(queryObj, columnsMap); result.TotalItems = await query.CountAsync(); query = query.ApplyPaging(queryObj); result.Items = await query.ToListAsync(); return(result); }
public ColumnMap GetColumnMap(string propertyName) { if (ColumnsMap.ContainsKey(propertyName)) { return(ColumnsMap[propertyName]); } if (_baseModelMap != null) { return(_baseModelMap.GetColumnMap(propertyName)); } return(null); }
public ProductRepository(StoreContext context) { _context = context; _sortColumnsMap = ColumnsMap.CreateSortColumnsMap(); }