using (var client = new HttpClient())
{
var WVMId = DB.Vehicles.Where(v => v.Id == new Guid(vehicleId)).Select(v => v.WVMID).FirstOrDefault();
var reqUrl = baseUrl + url;
var respurl = string.Format(reqUrl, WVMId);
var response = client.GetStringAsync(respurl).Result;
var json = JArray.Parse(response);
foreach (var temp in json)
{
var model = temp.ToObject(typeof(VehicleMaintenanceItemData), new Newtonsoft.Json.JsonSerializer()) as VehicleMaintenanceItemData;
maintenanceItems.Add(model);
}
return maintenanceItems;
}
时间: 2024-10-03 22:33:26