public async Task <PagedResultOutput <ZoneListDto> > GetZones(GetZonesInput input) { IQueryable <Zone> all = this._zoneRepository.GetAll(); IQueryable <Zone> zones = all.WhereIf <Zone>(!input.Filter.IsNullOrEmpty(), (Zone p) => p.Name.Contains(input.Filter) || p.Caption.Contains(input.Filter)); int num = await zones.CountAsync <Zone>(); List <Zone> listAsync = await zones.OrderBy <Zone>(input.Sorting, new object[0]).PageBy <Zone>(input).ToListAsync <Zone>(); return(new PagedResultOutput <ZoneListDto>(num, listAsync.MapTo <List <ZoneListDto> >())); }
public ActionResult Index(GetZonesInput input) { ((dynamic)base.ViewBag).GoogleMapsApiKey = ConfigurationManager.AppSettings["Maps.Google.ApiKey"].ToString(); return(base.View()); }