title: convert multi level for loop into linq or lambda expression
body: <p>I already posted related question as follows: </p>
  
  <p><a href="https://stackoverflow.com/questions/12923220/replace-3-levels-of-nested-for-loops-by-efficient-code-possibly-linq">replace 3 levels of nested for loops by efficient code possibly linq</a></p>
  
  <p>But since I am not good with Linq or Lambda expression.. I am not sure how to further expand on it.</p>
  
  <p>I have a slightly different 3 level nested for loop that I don't know how to transfer it into Linq or Lambda expression.. I have been tasked at work to come up with more efficient replacement code for the following in linq or lambda expression .. Please help. thanks..</p>
  
  <pre><code>public static void CompareEntities(
      out EntityCollection&lt;StringResourceEntity&gt; entitiesDifference,
      EntityCollection&lt;StringResourceEntity&gt; entitiesLargerSet,
      EntityCollection&lt;StringResourceEntity&gt; entitiesSmallerSet)
  {
      var diff = new EntityCollection&lt;StringResourceEntity&gt;();
      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) &amp;&amp;
                          stringResValSmall.Value.Length &gt; 0)
                      {
                          entityMatch = true;
                      }
                  }
              }
          }
  
          if (entityMatch == false)
          {
              diff.Add(entityLargerSet);
          }
      }
  
      entitiesDifference = diff;
  }
  </code></pre>