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

            Prospect = await _context.Prospect.SingleOrDefaultAsync(m => m.Id == id);

            if (Prospect == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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