예제 #1
0
        public async Task <IActionResult> OnGetAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

            if (gruz == null)
            {
                return(NotFound());
            }
            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnPostAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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