私はすでに次のように関連する質問を投稿しました:
ネストされたforループの3つのレベルを、おそらくlinqの効率的なコードに置き換えます
しかし、LinqやLambdaの表現が苦手なので、それをさらに拡張する方法がわかりません。
わずかに異なる3レベルのネストされたforループがあり、LinqまたはLambda式に転送する方法がわかりません。linqまたはlambda式で次のより効率的な置換コードを考え出すように仕事をしています。 。 助けてください。ありがとう..
public static void CompareEntities(
    out EntityCollection<StringResourceEntity> entitiesDifference,
    EntityCollection<StringResourceEntity> entitiesLargerSet,
    EntityCollection<StringResourceEntity> entitiesSmallerSet)
{
    var diff = new EntityCollection<StringResourceEntity>();
    string defaultCulture = LocalizationConfiguration.DefaultCulture;
    foreach (StringResourceEntity entityLargerSet in entitiesLargerSet)
    {
        bool entityMatch = false;
        foreach (StringResourceEntity entitySmallerSet in entitiesSmallerSet)
        {
            if (entityLargerSet.Key.Equals(entitySmallerSet.Key))
            {
                foreach (var stringResValSmall in entitySmallerSet.StringResourceValues)
                {
                    if (stringResValSmall.Culture.Equals(defaultCulture) &&
                        stringResValSmall.Value.Length > 0)
                    {
                        entityMatch = true;
                    }
                }
            }
        }
        if (entityMatch == false)
        {
            diff.Add(entityLargerSet);
        }
    }
    entitiesDifference = diff;
}