public async Task <IActionResult> BusStop(int id, [FromQuery] string dateTime) { DateTime dateTimeObj = DateTime.Parse(dateTime); var busStop = await busService.GetBusStop(id, dateTimeObj); if (busStop == null) { return(BadRequest(new ApiError($"There is no {id} stop in the database"))); } busStop.Self = LinkGenerator.To(RouteNames.BusStop, new { id = id, dateTime = dateTime }); return(Ok(busStop)); }