public async Task <IActionResult> Get()
 {
     try
     {
         return(Ok(await service.Get()));
     }
     catch (Exception e)
     {
         return(NotFound(e.Message));
     }
 }
예제 #2
0
 public IActionResult Get()
 {
     try
     {
         return(Ok(service.Get()));
     }
     catch (Exception)
     {
         return(NotFound());
     }
 }
예제 #3
0
        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));
        }
예제 #4
0
 public async Task <IActionResult> GetById(int id)
 {
     return(Json(await _service.Get(id)));
 }
예제 #5
0
 public async Task <IActionResult> GetAll()
 {
     return(Ok(await service.Get()));
 }
 public IEnumerable <Departure> Get()
 {
     return(service.Get());
 }