public ActionResult GetVehicle(string brand) { using (var client = new Tuhu.Service.Vehicle.VehicleClient()) { var result = client.GetAllVehicles(); result.ThrowIfException(true); return(Content(JsonConvert.SerializeObject(result.Result.Where(_ => _.Brand == brand).Select(_ => new { CarName = _.Vehicle, _.VehicleId }).Distinct()))); } }
public ActionResult GetBrand() { using (var client = new Tuhu.Service.Vehicle.VehicleClient()) { var result = client.GetAllVehicles(); result.ThrowIfException(true); return(Content(JsonConvert.SerializeObject(result.Result.Select(_ => new { _.Brand }).Distinct()))); } }