常用方法
常用方法
常用方法
常用方法
public async Task <ActionResult <Model.Receita> > PostAsync(ReceitaModel receita) { try { var mapper = _mapper.Map <Model.Receita>(receita); var total = await _service.AddAsync(mapper); if (total > 0) { return(new CreatedResult("", mapper)); } return(new AcceptedResult()); } catch (Exception ex) { return(new BadRequestObjectResult(ex)); } }