public ActionResult Delete(int id) { Vehicles vehicle = new Vehicles(); try { if (ModelState.IsValid) { VehicleServiceClient vehicleServiceClient = new VehicleServiceClient(); vehicle = vehicleServiceClient.GetVehicles(id); } } catch (Exception e) { ModelState.AddModelError("error", "Something Went Wrong"); vehicle = null; throw e; } return(View(vehicle)); }