Есть запрос, как правильно сделать так что бы использовать в нём CompiledQuery?
public static IEnumerable<IEnumerable<IPrecodeDefinition>> CartesianProduct(
IEnumerable<IEnumerable<IPrecodeDefinition>> sequences)
{
// основа индукции:
IEnumerable<IEnumerable<IPrecodeDefinition>> result = new[] { Enumerable.Empty<IPrecodeDefinition>() };
foreach (var sequence in sequences)
{
var s = sequence;
// нельзя замыкаться на переменную цикла
// индукционный переход: используем SelectMany, чтобы построить новое произведение из старого
result = from seq in result from item in s select seq.Concat(new[] { item });
}
Спасибо!