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