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

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

            if (Putevki == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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