public async Task <IActionResult> OnGetAsync(string id) { if (id == null) { return(NotFound()); } KnowYourMeme = await _context.KnowYourMeme.SingleOrDefaultAsync(m => m.Genre == id); if (KnowYourMeme == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(string id) { if (id == null) { return(NotFound()); } KnowYourMeme = await _context.KnowYourMeme.FindAsync(id); if (KnowYourMeme != null) { _context.KnowYourMeme.Remove(KnowYourMeme); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }