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