我有一个简单的ConcurrentDictionary,我正在尝试选择值的子集。
我正在使用此代码,我可以使用它的唯一方法是var来声明testStudents。这段代码的正确声明是什么?我尝试了List和IEnumratable,但它们没有用。
public ConcurrentDictionary<string, Student> _Student = new ConcurrentDictionary<string, Student>();
var testStudents = this._Student.Values.Select( s => s.Name = "jack");
答案 0 :(得分:0)
谢谢大家。看起来我使用的是错误的方法。我需要使用Where
方法。
IEnumerable<Student> testStudents
= this._Student.Values.Where( s => s.Name = "jack");