public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Salon = await _context.Salons.FirstOrDefaultAsync(m => m.ID == id); if (Salon == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Salon = await _context.Salons.FindAsync(id); if (Salon != null) { _context.Salons.Remove(Salon); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }