Пример #1
0
        public IActionResult GetAllPlaces(string name, string location, string city, int offset, int limit = 10)
        {
            var request = new PlaceSearchRequest()
            {
                Name = name, Location = location, City = city, Limit = limit, Offset = offset
            };

            _logger.Information(request.ToString());
            var response = _placeServices.GetAllPlaces(request);

            if (!response.Result)
            {
                return(BadRequest(response.Errors));
            }

            if (response.Places.Count == 0)
            {
                return(NotFound(request));
            }

            return(Ok(response.Places));
        }
Пример #2
0
        public List <Place> Get()
        {
            var list = _placeService.GetAllPlaces().ToList();

            return(list);
        }
Пример #3
0
        public async Task <IActionResult> GetAllPlaces()
        {
            var places = await _placesService.GetAllPlaces();

            return(Ok(places));
        }