title: Nested foreach conversion to LINQ with a condition on two lists
body: <p>LINQ is like voodo magic to me. No need to show you what I've done, nothing works or even compiles, I'm just getting error in a somewhat not understandable language:</p>
  
  <p><code>The type arguments for method 'System.Linq.Enumerable.SelectMany&lt;TSource,TResult&gt;(System.Collections.Generic.IEnumerable&lt;TSource&gt;, System.Func&lt;TSource,int,System.Collections.Generic.IEnumerable&lt;TResult&gt;&gt;)' cannot be inferred from the usage. Try specifying the type arguments explicitly.</code></p>
  
  <p>So, here's my code:</p>
  
  <pre><code>foreach (string first in firstStrings)
      foreach (string second in secondStrings)
      {
          try {
              if (second.Contains(DoFormatting(first)))
                  DoStuff(first, second);
          }
          catch (Exception e)
          {
              LogStuff(first, second);
          }
      }
  </code></pre>
  
  <p><strong>(How) can I translate it to Linq?</strong></p>