public async Task <IActionResult> OnGetAsync(long?id) { if (id == null) { return(NotFound()); } Policy_type = await _context.Policy_type.FirstOrDefaultAsync(m => m.ID == id); if (Policy_type == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(long?id) { if (id == null) { return(NotFound()); } Policy = await _context.Policy_type.FirstOrDefaultAsync(m => m.ID == id); if (Policy == null) { return(NotFound()); } Policies = await _context.Policies.Where(m => m.Policy_typeID == Policy.ID).ToListAsync(); return(Page()); }
public async Task <IActionResult> OnPostAsync(long?id) { if (id == null) { return(NotFound()); } Policy_type = await _context.Policy_type.FindAsync(id); if (Policy_type != null) { _context.Policy_type.Remove(Policy_type); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }