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