public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            GranteeService = await _context.GranteeService.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            GranteeService = await _context.GranteeService
                             .Include(g => g.Grantee)
                             .Include(g => g.Organization).FirstOrDefaultAsync(m => m.Id == id);

            if (GranteeService == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            GranteeService = await _context.GranteeService
                             .Include(g => g.Grantee)
                             .Include(g => g.Organization).FirstOrDefaultAsync(m => m.Id == id);

            if (GranteeService == null)
            {
                return(NotFound());
            }
            ViewData["GranteeId"]      = new SelectList(_context.Grantee, "Id", "Name");
            ViewData["OrganizationId"] = new SelectList(_context.Organization, "Id", "Name");
            return(Page());
        }