Ejemplo n.º 1
0
        public IActionResult Get()
        {
            try
            {
                var results = _repository.GetAllParkings();
                if (!results.Any())
                {
                    return(NotFound("List of parkings is empty"));
                }

                return(Ok(results));
            }
            catch (ArgumentNullException)
            {
                return(NotFound("None parking found"));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Database Failed"));
            }
        }