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

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

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

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

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

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