public async Task <ActionResult> Put(int id, [FromForm] CombustibleDTO combustibleDTO) { var updateCombustible = _mapper.Map <Combustible>(combustibleDTO); updateCombustible.Id = id; await _combustibleService.UpdateCombustible(updateCombustible); return(NoContent()); }
public async Task <ActionResult> Post([FromForm] CombustibleDTO combustibleDTO) { var combustible = _mapper.Map <Combustible>(combustibleDTO); await _combustibleService.InsertCombustible(combustible); combustibleDTO = _mapper.Map <CombustibleDTO>(combustible); var response = new ApiResponse <CombustibleDTO>(combustibleDTO); return(Created(nameof(Get), new { id = combustible.Id, response })); }