【发布时间】:2016-07-21 18:07:16
【问题描述】:
所以我有几段代码可以用来做类似的事情
List<ParameterInfo> theseParams = this.Action.GetParameters().OrderBy(p => p.Name).ToList(),
otherParams = other.Action.GetParameters().OrderBy(p => p.Name).ToList();
if(theseParams.Count != otherParams.Count)
return false;
for(int i = 0; i < theseParams.Count; ++i)
{
ParameterInfo thisParam = theseParams[i],
otherParam = otherParams[i];
if(thisParam.Name != otherParam.Name)
return false;
}
return true;
我想知道是否有一种紧凑的方法可以一次迭代到列表?
【问题讨论】: