public async Task <ActionResult <AirplaneViewModel> > Get(Guid id)
        {
            var user = (await _airplaneService.GetById(id)).ToViewModel();

            if (user == null)
            {
                _logger.LogInformation($"Airplane id = {id} not found.");
                return(NotFound());
            }
            return(new ObjectResult(user));
        }
예제 #2
0
        public async Task <IActionResult> Get(int id)
        {
            AirplaneDTO plane = await service.GetById(id);

            if (plane == null)
            {
                return(NotFound());
            }
            return(Ok(plane));
        }
예제 #3
0
 public AirplaneDto GetById(Guid id)
 {
     return(_service.GetById(id));
 }
예제 #4
0
 public Airplane Get(int id)
 {
     return(service.GetById(id));
 }
 public Airplane GetById(int id)
 {
     return(_airplaneService.GetById(id));
 }
예제 #6
0
 public async Task <AirplaneViewModel> GetById([FromRoute] Guid id)
 {
     return(_mapper.Map <AirplaneViewModel>(await _dbAirplane.GetById(id)));
 }