public async Task <IActionResult> OnGetAsync(long?id) { if (id == null) { return(NotFound()); } GroupOfClients = await _context.GroupOfClients.FirstOrDefaultAsync(m => m.GroupId == id); if (GroupOfClients == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(long?id) { if (id == null) { return(NotFound()); } GroupOfClients = await _context.GroupOfClients.FindAsync(id); if (GroupOfClients != null) { _context.GroupOfClients.Remove(GroupOfClients); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(long?id) { if (id == null) { return(NotFound()); } Groups = _context.GroupOfClients.First(m => m.GroupId == id); if (Groups == null) { return(NotFound()); } Client = await _context.Client .Include(e => e.Group).Where(m => m.GroupId == Groups.GroupId).ToListAsync(); return(Page()); }