public async Task <IActionResult> OnPost() { loading.GetName(); if (ModelState.IsValid) { var bookFromdb = await db.Books.FindAsync(Book.Id); bookFromdb.Name = Book.Name; bookFromdb.ISBN = Book.ISBN; bookFromdb.Author = Book.Author; await db.SaveChangesAsync(); return(RedirectToPage("Index")); } return(RedirectToPage()); }