public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            UserBookEntry = await _context.UserBookEntry.FirstOrDefaultAsync(m => m.UserBookEntryID == id);

            if (UserBookEntry == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            UserBookEntry = await _context.UserBookEntry.FindAsync(id);

            if (UserBookEntry != null)
            {
                _context.UserBookEntry.Remove(UserBookEntry);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }