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

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

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

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

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

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