Ejemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <Parky> > > GetParks()
        {
            try
            {
                var parksFromRepo = await _repository.GetAllParks();

                return(Ok(parksFromRepo));
            }
            catch (Exception e)
            {
                _logger.LogError($"Something went wrong in the {nameof(GetParks)} action {e}");
                return(StatusCode(500, "Internal server error"));
            }
        }
Ejemplo n.º 2
0
        public IActionResult Personal()
        {
            var results = _repository.GetAllParks();

            return(View(results));
        }