2009-08-25 17 views

Antwort

27
Group.Where(x => x != null) 
    .SelectMany(g => combination.Where(c => c != null) 
           .Select(c => new {Group = g, Combination = c})); 

Alternativ:

from g in Group where g != null 
from c in combination where c != null 
select new { Group = g, Combination = c } 
+0

Dank Mehrdad für sofortige Reaktion. – user160677

+1

Irgendeine Idee, wie man dies effizient macht, um Permutationen nicht nur Kombinationen zu bekommen? (Bedeutet {"A", "C#"} und {"C#", "A"} werden als zwei separate Artikel betrachtet)? –

Verwandte Themen