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