Exemplo n.º 1
0
        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());
        }