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")); } }
public IActionResult Personal() { var results = _repository.GetAllParks(); return(View(results)); }