public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Books_detail = await _context.Books_detail .Include(b => b.Author).FirstOrDefaultAsync(m => m.Id == id); if (Books_detail == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Books_detail = await _context.Books_detail.FindAsync(id); if (Books_detail != null) { _context.Books_detail.Remove(Books_detail); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Books_detail = await _context.Books_detail .Include(b => b.Author).FirstOrDefaultAsync(m => m.Id == id); if (Books_detail == null) { return(NotFound()); } ViewData["AuthorId"] = new SelectList(_context.Author, "Id", "Email_Id"); return(Page()); }