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;
}
相关文章
- Angular 1.6 $ http.get无法从json读取
- 从字符串获取JSON值
- 在Swift中从JSON数组获取字符串
- 无法从NSDictionary和JSON获取值
- Entity Framework中编辑时错误ObjectStateManager 中已存在具有同一键的对象
- Expo大作战(三十七)--expo sdk api之 GLView,GestureHandler,Font,Fingerprint,DeviceMotion,Brightness
- c#调用API的CreateFontIndirect设置字体,编译提示“值不在预期范围”求解?
- Java的字体类详解(Font)-摘自Java API文档
- python操作字符串类型json的注意点
- boost解析json