2009-08-25 19 views

Respuesta

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

alternativa:

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

Gracias Mehrdad para una respuesta inmediata. – user160677

+1

¿Alguna idea de cómo hacer esto de manera eficiente para obtener permutaciones no solo de combinaciones? (es decir, {"A", "C#"} y {"C#", "A"} se considerarán dos elementos separados). –

Cuestiones relacionadas