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

            NotificationSettings = await _context.NotificationSettings.FirstOrDefaultAsync(m => m.Id == id);

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

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

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

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