public ActionResult <PaginatedDTO <FlightHistoryDTO> > GetStationFlightHistory([Required, FromQuery] Guid stationId, [FromQuery, DefaultValue(0)] int startFrom, [FromQuery, DefaultValue(15)] int paginationLimit) { if (stationId == Guid.Empty) { HttpResponseDTO response = new() { ResponseType = Constants.RESPONSE_TYPE_FAILURE, Message = "Invalid Id!", FailureReason = "Id must be an actual UUID!" }; return(BadRequest(response)); } if (startFrom < 0) { HttpResponseDTO response = new() { ResponseType = Constants.RESPONSE_TYPE_FAILURE, Message = "Invalid start point.", FailureReason = "Can't start retrieving data from negative records!" }; return(BadRequest(response)); } if (paginationLimit < 1) { HttpResponseDTO response = new() { ResponseType = Constants.RESPONSE_TYPE_FAILURE, Message = "Invalid pagination limit!", FailureReason = "Can't fetch less than one item per page." }; return(BadRequest(response)); } try { return(airportService.GetStationHistory(stationId, startFrom, paginationLimit)); } catch (KeyNotFoundException e) { HttpResponseDTO response = new() { ResponseType = Constants.RESPONSE_TYPE_FAILURE, Message = "No station with the given ID was found.", FailureReason = e.Message }; return(NotFound(response)); } catch (Exception e) { HttpResponseDTO response = new() { ResponseType = Constants.RESPONSE_TYPE_FAILURE, Message = Constants.UNKNOWN_ERROR_MSG, FailureReason = e.Message }; return(StatusCode(StatusCodes.Status500InternalServerError, response)); } }