public IActionResult GetAll() { var list = _services.GetAll(); var listMap = _mapper.Map <IEnumerable <CityModel> >(list); return(Ok(listMap)); }
public HttpResponseMessage GetAll() { var city = _cityServices.GetAll(); if (city != null) { var cityEntities = city as List <CityEntity> ?? city.ToList(); if (cityEntities.Any()) { return(Request.CreateResponse(HttpStatusCode.OK, cityEntities)); } } throw new ApiDataException(1000, "city not found", HttpStatusCode.NotFound); }
public IResponseDTO GetPage(int pageNumber = 0, int pageSize = 0) { var result = ServicesCity.GetAll(pageNumber, pageSize); return(result); }
public IEnumerable <CityModel> GetAll(int id) { return(_service.GetAll(id)); }
public async Task <ActionResult <IEnumerable <City> > > GetCities() { return(await services.GetAll()); }