예제 #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Group = await _groupService.GetGroupByGroupId(id);

            if (Group == null)
            {
                return(NotFound());
            }
            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Group = await _context.Groups.FirstOrDefaultAsync(m => m.GroupId == id);

            if (Group == null)
            {
                return(NotFound());
            }
            return(Page());
        }
예제 #3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Group = await _context.Groups.FindAsync(id);

            if (Group != null)
            {
                _context.Groups.Remove(Group);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }