public async Task <IActionResult> Get() { try { return(Ok(await service.Get())); } catch (Exception e) { return(NotFound(e.Message)); } }
public IActionResult Get() { try { return(Ok(service.Get())); } catch (Exception) { return(NotFound()); } }
public IActionResult Get(Guid id) { DepartureDto departureDto; try { departureDto = departureService.Get(id); } catch (Exception ex) { return(BadRequest(new { ErrorType = ex.GetType().Name, ex.Message })); } return(Ok(departureDto)); }
public async Task <IActionResult> GetById(int id) { return(Json(await _service.Get(id))); }
public async Task <IActionResult> GetAll() { return(Ok(await service.Get())); }
public IEnumerable <Departure> Get() { return(service.Get()); }