Linq equivalent
foreach (ParameterGroup paramGroup in ParamGroups)
{
foreach (Parameter parameter in paramGroup.Paramete开发者_Go百科rList)
{
if (parameter.ParameterId == parameterId)
return paramGroup.GroupId;
}
}
What would be LINQ eqiavalent?
return (from paramGroup in ParamGroups
from parameter in paramGroup.ParameterList
where parameter.ParameterId == parameterId
select paramGroup.GroupId).FirstOrDefault();
精彩评论