コード例 #1
0
        public ActionResult<AccelerationDTO> Get(int id)

        {

            return Ok(_mapper.Map<AccelerationDTO>(_service.FindById(id)));

        }
コード例 #2
0
        public ActionResult <AccelerationDTO> Get(int id)
        {
            var accelid    = _service.FindById(id);
            var accelidDTO = _mapper.Map <AccelerationDTO>(accelid);

            return(Ok(accelidDTO));
        }
コード例 #3
0
 public ActionResult <AccelerationDTO> Get(int?id)
 {
     if (id == null)
     {
         return(NoContent());
     }
     else
     {
         var idNotNull    = id.GetValueOrDefault();
         var acceleration = _accelerationService.FindById(idNotNull);
         return(Ok(_mapper.Map <AccelerationDTO>(acceleration)));
     }
 }
コード例 #4
0
        public ActionResult <AccelerationDTO> Get(int id)
        {
            Acceleration acceleration = _accelerationService.FindById(id);

            AccelerationDTO accelerationDTO = null;

            if (acceleration != null)
            {
                accelerationDTO = _mapper.Map <AccelerationDTO>(acceleration);
            }

            return(Ok(accelerationDTO));
        }
        public ActionResult <AccelerationDTO> Get(int id)
        {
            var _acceleration = _accelerationService.FindById(id);

            if (_acceleration != null)
            {
                var retorno = _mapper.Map <AccelerationDTO>(_acceleration);
                return(Ok(retorno));
            }
            else
            {
                return(NoContent());
            }
        }
コード例 #6
0
        public ActionResult <AccelerationDTO> Get(int id)
        {
            var acceleration = _accelerationService.FindById(id);

            if (acceleration != null)
            {
                // Substituir mapeamento de objeto manual por mapeamento com AutoMapper

                return(Ok(_mapper.Map <AccelerationDTO>(acceleration)));
            }
            else
            {
                return(NotFound());
            }
        }
コード例 #7
0
        public ActionResult <IEnumerable <AccelerationDTO> > Get(int Id)
        {
            var acceleration = _accelerationService.FindById(Id);

            if (acceleration != null)
            {
                var retorno = _mapper.Map <AccelerationDTO>(acceleration);

                return(Ok(retorno));
            }
            else
            {
                return(NotFound());
            }
        }
コード例 #8
0
 public ActionResult <AccelerationDTO> Get(int id)
 {
     try
     {
         var acceleration = _service.FindById(id);
         var result       = _mapper.Map <AccelerationDTO>(acceleration);
         if (result == null || result.Id != id)
         {
             return(NotFound(id));
         }
         return(Ok(result));
     }
     catch (Exception)
     {
         throw;
     }
 }
        public ActionResult <AccelerationDTO> Get(int id)
        {
            //deve apontar para o método FindById e retornar um AccelerationDTO
            var acceleration = _accelerationService.FindById(id);


            if (acceleration != null)
            {
                var retorno = _mapper.Map <AccelerationDTO>(acceleration);

                return(Ok(retorno));
            }

            else
            {
                return(NotFound());
            }
        }
コード例 #10
0
        public ActionResult <AccelerationDTO> Get(int id)
        {
            var company = _accelerationService.FindById(id);

            return(Ok(_mapper.Map <AccelerationDTO>(company)));
        }
コード例 #11
0
        public ActionResult <AccelerationDTO> Get(int id)
        {
            var obj = mapper.Map <AccelerationDTO>(service.FindById(id));

            return(Ok(obj));
        }
コード例 #12
0
        public ActionResult <AccelerationDTO> Get(int id)
        {
            var result = _service.FindById(id);

            return(Ok(_mapper.Map <AccelerationDTO>(result)));
        }
コード例 #13
0
        public ActionResult <AccelerationDTO> Get(int id)
        {
            var response = _mapper.Map <AccelerationDTO>(_accelerationService.FindById(id));

            return(Ok(response));
        }