public async Task Delete(int id) { var contract = await _context.Contracts.FindAsync(id); if (contract != null) { _context.Remove(contract); await _context.SaveChangesAsync(); } }