Пример #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ScheduleSyncSpec = await _context.ScheduleSyncSpecs.FirstOrDefaultAsync(m => m.ID == id);

            if (ScheduleSyncSpec == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ScheduleSyncSpec = await _context.ScheduleSyncSpecs.FindAsync(id);

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

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