Esempio n. 1
0
        public IActionResult GetAll()
        {
            var list    = _services.GetAll();
            var listMap = _mapper.Map <IEnumerable <CityModel> >(list);

            return(Ok(listMap));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public IResponseDTO GetPage(int pageNumber = 0, int pageSize = 0)
        {
            var result = ServicesCity.GetAll(pageNumber, pageSize);

            return(result);
        }
Esempio n. 4
0
 public IEnumerable <CityModel> GetAll(int id)
 {
     return(_service.GetAll(id));
 }
 public async Task <ActionResult <IEnumerable <City> > > GetCities()
 {
     return(await services.GetAll());
 }