// GET: Rent/Cancel public async Task <IActionResult> Cancel(int?id) { if (id != null) { Rent rent = await _context.Rents.SingleOrDefaultAsync(i => i.Id == id); _context.Remove(rent); await _context.SaveChangesAsync(); } return(RedirectToAction("Index")); }