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));
 }
 public async Task <AirplaneViewModel> GetById([FromRoute] Guid id)
 {
     return(_mapper.Map <AirplaneViewModel>(await _dbAirplane.GetById(id)));
 }