foreach (ParameterGroup paramGroup in ParamGroups)
{
foreach (Parameter parameter in paramGroup.ParameterList)
{
if (parameter.ParameterId == parameterId)
return paramGroup.GroupId;
}
}
什么是LINQ eqiavalent?
答案 0 :(得分:1)
return (from paramGroup in ParamGroups
from parameter in paramGroup.ParameterList
where parameter.ParameterId == parameterId
select paramGroup.GroupId).FirstOrDefault();