public async Task <IActionResult> PutSleeping([FromRoute] Sleeping editSleeping) { var result = await sleepingsService.UpdateSleeping(editSleeping); if (result == null) { return(NotFound()); } return(NoContent()); }
public async Task <IActionResult> OnPostAsync() { if (ModelState.IsValid) { var result = await sleepingsService.UpdateSleeping(EditSleeping); if (result != null) { return(RedirectToPage("/Sleepings/IndexSleeping", new { id = EditSleeping.BabyId })); } } return(Page()); }