public IActionResult ReturnLending(Lending model) { if (ModelState.IsValid) { model = lendingService.ReturnLentBook(model); lendingService.Commit(); TempData["Message"] = "Book returned!"; return(RedirectToAction("Details", "Client", new { id = model.ClientId })); } return(View(model)); }
public IActionResult OnPost() { if (ModelState.IsValid) { Lending = lendingService.ReturnLentBook(Lending); lendingService.Commit(); TempData["Message"] = "Book returned!"; return(RedirectToPage("/Clients/ClientDetails", new { id = Lending.ClientId })); } return(Page()); }