コード例 #1
0
        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());
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        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());
        }