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

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

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

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

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

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