public async Task <BaseResponse <IEnumerable <CityResponse> > > List(CityListRequest model) { IEnumerable <City> cityList = await _db.Cities.ToListAsync(); if (!string.IsNullOrEmpty(model.CityName)) { cityList = cityList.Where(x => x.CityName.Contains(model.CityName)); } int totalCount = cityList.Count(); var result = cityList.Skip((model.PageNumber - 1) * model.PageSize).Take(model.PageSize); IEnumerable <CityResponse> response = _mapper.Map <IEnumerable <CityResponse> >(result); if (response != null) { return(new BaseResponse <IEnumerable <CityResponse> > { Code = RsponseCode.Success, Message = "", Data = response, TotalCount = totalCount }); } return(new BaseResponse <IEnumerable <CityResponse> > { Code = RsponseCode.NotFound, Message = "لا يوجد بيانات ", Data = null }); }
public virtual async Task <CityListResponse> CityListAsync(Agent agent, CityListRequest cityListRequest) { return(await AgentConnect.CityListAsync(agent, cityListRequest)); }
public virtual CityListResponse CityList(Agent agent, CityListRequest cityListRequest) { return(AgentConnect.CityList(agent, cityListRequest)); }
public async Task <IActionResult> List([FromBody] CityListRequest model) { var result = await _clientService.List(model); return(Ok(result)); }
public async Task <IActionResult> GetCities([FromBody] CityListRequest request) { var result = await mediator.Send <IEnumerable <CityDTO> >(request); return(Json(result)); }
public async Task <IEnumerable <CityDTO> > Handle(CityListRequest request, CancellationToken cancellationToken) { return(await Task.FromResult <IEnumerable <CityDTO> >(new List <CityDTO>())); }