public ActionResult <BaseViewModel <PagingResult <RoleViewModel> > > GetAll([FromQuery] BaseRequestViewModel request) { //var a = request.Filters[0]; var data = _roleManager.Roles.ToList(); var result = new BaseViewModel <PagingResult <RoleViewModel> >(); result.Data = new PagingResult <RoleViewModel> { Results = _mapper.Map <IEnumerable <RoleViewModel> >(data), TotalRecords = data.Count, }; return(result); }
public async Task <BaseViewModel <PagingResult <ProductViewModel> > > GetAllProductsNoPaging(BaseRequestViewModel request) { return(await GetAll(new BasePagingRequestViewModel { PageIndex = null, PageSize = null, Filter = request.Filter, Include = request.Include, SortBy = request.SortBy }, Constants.DEAFAULT_DELETE_STATUS_EXPRESSION)); }
public async Task <BaseViewModel <PagingResult <OrderViewModel> > > GetAllOrdersByAdminNoPaging(BaseRequestViewModel request) { return(await GetAllOrder(new BasePagingRequestViewModel { Filter = request.Filter, Include = request.Include, SortBy = request.SortBy })); }
public async Task <BaseViewModel <PagingResult <LocationViewModel> > > GetAllLoctionsNoPaging(BaseRequestViewModel request) { var result = new BaseViewModel <PagingResult <LocationViewModel> >(); string filter = SearchHelper <Location> .GenerateStringExpression(request.Filter, Constants.DEAFAULT_DELETE_STATUS_EXPRESSION); Expression <Func <Location, bool> > FilterExpression = await LinqHelper <Location> .StringToExpression(filter); QueryArgs <Location> queryArgs = new QueryArgs <Location> { Filter = FilterExpression, Sort = request.SortBy, }; var data = _repository.Get(queryArgs.Filter, queryArgs.Sort).ToList(); //var sql = data.ToSql(); if (data == null || data.Count == 0) { result.Description = MessageHandler.CustomMessage(MessageConstants.NO_RECORD); result.Code = MessageConstants.NO_RECORD; } else { result.Data = new PagingResult <LocationViewModel> { Results = _mapper.Map <IEnumerable <LocationViewModel> >(data), TotalRecords = _repository.Count(queryArgs.Filter) }; } return(result); }
public async Task <ActionResult <BaseViewModel <PagingResult <LocationViewModel> > > > GetAllLocation([FromQuery] BaseRequestViewModel request) { //var a = request.Filters[0]; var result = await _locationService.GetAllLoctionsNoPaging(request); this.HttpContext.Response.StatusCode = (int)result.StatusCode; return(result); }
public async Task <ActionResult <BaseViewModel <PagingResult <OrderViewModel> > > > GetAllOrder([FromQuery] BaseRequestViewModel request) { var result = await _orderService.GetAllOrdersByAdminNoPaging(request); HttpContext.Response.StatusCode = (int)result.StatusCode; return(result); }