この質問は、指定された条件を満たすために列挙型を投影する際に技術的な助けを求めることです。
言う、
ボールには、2 つの赤いボールと 3 つの青いボールが含まれています。次の条件に基づいて、ボールを選択する必要があります。
(i) Each pair should contain one blue ball and one red ball
(ii) if the ball is "Blue1" ignore it
期待される結果は
{"Blue2","Red1" }
{"Blue2","Red2" }
{"Blue3","Red1" }
{"Blue3","Red2" }
結果を投影するために次のコードを完成させたいだけです。
var bag = new[] { "Red1", "Red2", "Blue1", "Blue2", "Blue3" };
var BallsProjection =
from blueball in bag
from redball in bag
**(What is the condition required here to select the balls)**
select new { ball1 = blueball, ball2 = redball };