public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            else
            {
                var acceleration = _mapper.Map <Models.Acceleration>(value);

                var retorno = _accelerationService.Save(acceleration);

                return(Ok(_mapper.Map <AccelerationDTO>(retorno)));
            }
        }
示例#2
0
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            Acceleration acceleration = _mapper.Map <Acceleration>(value);
            var          saved        = _mapper.Map <AccelerationDTO>(_service.Save(acceleration));

            return(Ok(saved));
        }
示例#3
0
        public ActionResult <CompanyDTO> Post([FromBody] AccelerationDTO value)
        {
            var dados         = _mapper.Map <Acceleration>(value);
            var registroSalvo = _accelerationService.Save(dados);

            return(Ok(_mapper.Map <AccelerationDTO>(registroSalvo)));
        }
示例#4
0
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            var acceleration = _mapper.Map <Acceleration>(value);

            acceleration = _service.Save(acceleration);
            return(Ok(_mapper.Map <AccelerationDTO>(acceleration)));
        }
        public ActionResult<AccelerationDTO> Post([FromBody] AccelerationDTO value)

        {

            return Ok(_mapper.Map<AccelerationDTO>(_service.Save(_mapper.Map<Acceleration>(value))));

        }
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            var converted = _mapper.Map <Acceleration>(value);
            var result    = _service.Save(converted);

            return(Ok(_mapper.Map <AccelerationDTO>(result)));
        }
示例#7
0
 public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     return(Ok(mapper.Map <AccelerationDTO>(service.Save(mapper.Map <Acceleration>(value)))));
 }
示例#8
0
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            var accel = _mapper.Map <Acceleration>(value);

            _service.Save(accel);

            var accelDto = _mapper.Map <AccelerationDTO>(accel);

            return(Ok(accelDto));
        }
示例#9
0
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            if (value != default)
            {
                var obj = mapper.Map <Acceleration>(value);
                obj = service.Save(obj);
                var listDTO = mapper.Map <AccelerationDTO>(obj);
                return(Ok(listDTO));
            }

            return(NoContent());
        }
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            var _value        = _mapper.Map <Acceleration>(value);
            var _acceleration = _accelerationService.Save(_value);

            if (_acceleration != null)
            {
                return(Ok(_mapper.Map <AccelerationDTO>(_acceleration)));
            }
            else
            {
                return(NoContent());
            }
        }
示例#11
0
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            // mapear Dto para Model
            var acceleration = _mapper.Map <Models.Acceleration>(value);
            //Salvar
            var retorno = _accelerationService.Save(acceleration);

            //mapear Model para Dto
            return(Ok(_mapper.Map <AccelerationDTO>(retorno)));
        }
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var acceleration = _mapper.Map <Acceleration>(value);

            _accelerationService.Save(acceleration);

            var response = _mapper.Map <AccelerationDTO>(acceleration);

            return(Ok(response));
        }
        public ActionResult <UserDTO> Post([FromBody] AccelerationDTO value)
        {
            if (value == null)
            {
                return(NoContent());
            }

            try
            {
                var acceleration = _accelerationService.Save(_mapper.Map <Acceleration>(value));
                return(Ok(_mapper.Map <AccelerationDTO>(acceleration)));
            }
            catch (Exception)
            {
                throw new Exception();
            }
        }
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            //deve receber um AccelerationDTO, apontar para o método Save e retornar um AccelerationDTO

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            // mapear Dto para Model
            var acceleration = _mapper.Map <Acceleration>(value);
            //Salvar
            var retorno = _accelerationService.Save(acceleration);

            //mapear Model para Dto
            return(Ok(_mapper.Map <AccelerationDTO>(retorno)));
        }
        public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value)
        {
            try
            {
                Acceleration user = _mapper.Map <Acceleration>(value);

                if (user == null)
                {
                    return(BadRequest());
                }

                _service.Save(user);
                var result = _mapper.Map <AccelerationDTO>(user);
                return(Ok(result));
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#16
0
        public Acceleration Post([FromBody] AccelerationDTO accelerationDTO)
        {
            Acceleration acceleration = _mapper.Map <Acceleration>(accelerationDTO);

            return(_accelerationService.Save(acceleration));
        }