System.Collections.Generic.IDictionary< String,bool>不包含“哪里"的定义 [英] System.Collections.Generic.IDictionary<String, bool> does not contain a definition for 'Where'
问题描述
我正在尝试使用linq表达式在.NET 3.5类库项目中过滤字典.我遇到的问题是,似乎没有引用正确的dll来执行此操作.
I am trying to filter a dictionary here in a .NET 3.5 class library project, using linq expressions. Problem I am having is I don't seem to have the right dlls referenced to carry this out, it seems.
当我尝试将以下代码放入
When I try to put the following code in
foreach (var item in TempFilesdictionary.Where(kvp => kvp.Value == false).ToList())
{
dic.Remove(item.Key);
}
我收到错误消息..
System.Collections.Generic.IDictionary< String,bool>
不包含"Where"的定义,也没有扩展方法"Where"接受类型为 System.Collections的第一个参数可以找到.Generic.IDictionary< String,Bool>
System.Collections.Generic.IDictionary<String, bool>
does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type System.Collections.Generic.IDictionary<String, Bool>
could be found
除了System.Core.dll,System.dll,System.Xml.Linq,我还需要在.NET 3.5库中引用哪些库来访问linq扩展方法?
What libraries do I need to reference in my .NET 3.5 library to access the linq extension methods, apart from System.Core.dll, System.dll, System.Xml.Linq?
推荐答案
您需要为 System.Linq
添加 using
指令.
这篇关于System.Collections.Generic.IDictionary< String,bool>不包含“哪里"的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!