public async Task<IActionResult> Delete(int? id) { if (id == null) { return NotFound(); } var contact = await GetContacts().SingleAsync(m => m.Id == id); if (contact == null) { return NotFound(); } return View(contact); }