public async Task <IActionResult> Post(StuffDto stuff) { _logger.LogInformation("POST operation started."); var result = await _stuffService.CreateAsync(_mapper.Map <Stuff>(stuff)); return(Created("", _mapper.Map <StuffDto>(result))); }
public async Task <IActionResult> Put(string id, StuffDto stuff) { _logger.LogInformation("PUT operation started."); if (await _stuffService.UpdateAsync(id, _mapper.Map <Stuff>(stuff))) { return(NoContent()); } else { return(BadRequest("The entity doesn't exist.")); } }