我调用了这个类Variables,它有多个成员,其中一个被称为Name字符串。假设我有一个List<Variables>. 这有Names, X, Y, Y.Z
string variableName = 'Y';
int _totalCount = (from p in variableList
where p.Name == variableName
select p.Name).Count();
int _totalCount2 = variableList.Select(x => x.Name == variableName).Count();
问题:为什么_totalCount退货2(这是我想要的)而_totalCount2退货4?