常用方法
常用方法
常用方法
常用方法
public async Task <IActionResult> PutAsync(int id, ReceitaModel receita) { try { var mapper = _mapper.Map <Model.Receita>(receita); mapper.Id = id; var total = await _service.UpdateAsync(mapper); if (total > 0) { return(new OkObjectResult(mapper)); } return(new NotFoundResult()); } catch (Exception ex) { return(new BadRequestObjectResult(ex)); } }