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