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

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

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

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

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

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