public ActionResult Edit(int client_id) { var client = ctx.clients.Where(x => x.id == client_id).FirstOrDefault(); if (client != null) { return View(client); } throw new ArgumentException("Client not found!"); }