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))); } }
public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value) { Acceleration acceleration = _mapper.Map <Acceleration>(value); var saved = _mapper.Map <AccelerationDTO>(_service.Save(acceleration)); return(Ok(saved)); }
public ActionResult <CompanyDTO> Post([FromBody] AccelerationDTO value) { var dados = _mapper.Map <Acceleration>(value); var registroSalvo = _accelerationService.Save(dados); return(Ok(_mapper.Map <AccelerationDTO>(registroSalvo))); }
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))); }
public ActionResult <AccelerationDTO> Post([FromBody] AccelerationDTO value) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } return(Ok(mapper.Map <AccelerationDTO>(service.Save(mapper.Map <Acceleration>(value))))); }
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)); }
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()); } }
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; } }
public Acceleration Post([FromBody] AccelerationDTO accelerationDTO) { Acceleration acceleration = _mapper.Map <Acceleration>(accelerationDTO); return(_accelerationService.Save(acceleration)); }