Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在JArray上找不到Select方法_C#_Windows Phone 8_Json.net - Fatal编程技术网

C# 在JArray上找不到Select方法

C# 在JArray上找不到Select方法,c#,windows-phone-8,json.net,C#,Windows Phone 8,Json.net,我在WP8C#项目中使用Newtownsoft.Json 我不明白为什么我的JArray对象不能使用linqtojson中的Select方法 我在cs文件的顶部有: using Windows.Data.Json; using Newtonsoft.Json.Linq; 然后: JsonObject JsonObject=new JsonObject(); var sr=新的StreamReader(如结果); var lignes=sr.ReadToEnd(); JObject o=JObj

我在WP8C#项目中使用Newtownsoft.Json

我不明白为什么我的
JArray
对象不能使用linqtojson中的
Select
方法

我在cs文件的顶部有:

using Windows.Data.Json;
using Newtonsoft.Json.Linq;
然后:

JsonObject JsonObject=new JsonObject();
var sr=新的StreamReader(如结果);
var lignes=sr.ReadToEnd();
JObject o=JObject.Parse(对齐);
JArray featureArray=(JArray)o[“features”];
IList features=featureArray.Select(p=>new ItemViewModel。。。
。选择
会引发编译错误


我缺少什么?

Select
System.Linq
命名空间中的一个扩展方法

你需要包括

using System.Linq;

在您的代码顶部以及使用语句的其他

我遇到了JArray上没有的任何方法的类似问题。就是这样!
using System.Linq;