public async Task <ActionResult <TimeTable[]> > GetTimeTables(int minMinutes, int maxMinutes, bool includePassengers = false, bool includeRoutes = false) { try { var results = await _repository.GetTimeTables(minMinutes, maxMinutes, includePassengers, includeRoutes); return(Ok(results)); } catch (Exception e) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Database Failure: {e.Message}")); } }
public async Task <ActionResult <TimeTableDto[]> > GetTimeTables(int minMinutes, int maxMinutes, bool includePassengers = false, bool includeRoutes = false) { try { var results = await _timeTableRepository.GetTimeTables(minMinutes, maxMinutes, includePassengers, includeRoutes); var Timetableresult = _mapper.Map <TimeTableDto[]>(results).Select(m => HateoasMainLinksTimeTable(m)); if (results == null) { return(NotFound($"Could not find any timetables")); } return(Ok(Timetableresult)); } catch (Exception e) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Database Failure: {e.Message}")); } }
public async Task <IEnumerable <TimeTable> > GetTimetableove() { return(await _timeTableRepository.GetTimeTables()); }