public async Task <ActionResult <CheckList> > Add(CheckListAdd checkList) { var result = await checkListRepository.AddAsync(checkList); if (result == null) { return(this.ValidateAndBadRequest()); } else { return(result); } }
public async Task <IActionResult> Add([FromBody] CheckListAdd checkList) { if (ModelState.IsValid) { var result = await repository.AddAsync(checkList); if (result == null) { this.UpdateValidations(); } else { return(Ok(result)); } } HttpContext.Response.StatusCode = 400; return(PartialView(checkList)); }