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

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

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

            Conductor = await _context.Conductors.FindAsync(id);

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

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