public Task <PagedList <StateProvinceView> > Handle(GetAllStateProvinceCommand request, CancellationToken cancellationToken) { var pagedList = _stateProvinceService.GetAll(request.CountryId, pageIndex: request.Paged.PageIndex, pageSize: request.Paged.PageSize); return(Task.FromResult(pagedList.ConvertPagedList <Nop.Core.Domain.Directory.StateProvince, StateProvinceView>())); }
//[Authorize(Roles = nameof(PermissionProvider.ViewProduct))] public HttpResponseMessage getAll(HttpRequestMessage request, int page = 0, int pageSize = 20, string filter = "", int countryRegionId = 0) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; var model = _stateProvinceService.GetAll(page + 1, pageSize, filter, countryRegionId); PaginationSet <StateProvince> pagedSet = new PaginationSet <StateProvince>() { Page = page, TotalCount = model.TotalItemCount, TotalPages = (int)Math.Ceiling((decimal)model.TotalItemCount / pageSize), Items = model }; response = request.CreateResponse(HttpStatusCode.OK, pagedSet); return response; })); }
public ActionResult ForeignCategory() { MenuGeographyVm model = new MenuGeographyVm(); var modelContinent = _continentService.GetAll(true); var modelCountryRegion = _countryRegionService.GetAll(true); var modelStateProvince = _stateProvinceService.GetAll(true); var modelArea = _areaService.GetAll(true); model.Continents = Mapper.Map <List <ContinentVm> >(modelContinent); model.CountryRegions = Mapper.Map <List <CountryRegionVm> >(modelCountryRegion); model.StateProvinces = Mapper.Map <List <StateProvinceVm> >(modelStateProvince); model.Areas = Mapper.Map <List <AreaVm> >(modelArea); return(PartialView(model)); }