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

            DevoteeDetail = await _context.DevoteeDetails
                            .Include(d => d.Devotee).FirstOrDefaultAsync(m => m.Id == id);

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

            DevoteeDetail = await _context.DevoteeDetails
                            .Include(d => d.Devotee).FirstOrDefaultAsync(m => m.Id == id);

            if (DevoteeDetail == null)
            {
                return(NotFound());
            }
            ViewData["DevoteeId"] = new SelectList(_context.Devotees, "Id", "FirstName");
            return(Page());
        }
Exemple #3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            DevoteeDetail = await _context.DevoteeDetails.FindAsync(id);

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

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