I have a Linq to Entities query like this:
var x = from a in SomeData
where ... some conditions ...
select new MyType
{
Property = a.Property,
ChildCollection = from b in a.Children
select new MyChildType
{
SomeProperty = b.Property,
AnotherProperty = b.AnotherProperty
}
};
var y = from a in SomeData
where ... some other conditions ...
select new MyType
{
Property = a.Property,
ChildCollection = from b in a.Children
select new MyChildType
{
SomeProperty = b.Property,
AnotherProperty = b.AnotherProperty
}
};
var results = x.Concat(y);
(This is a simplified example - the where and select clauses are more complex than shown here. I use separate query queries because creating one combined query is just too complicated, has too many conventions, and takes age to compile)
It compiles normally, but fails when executed with the exception of:
"The nested query is not supported. Operation1='UnionAll' Operation2='MultiStreamNest'
Notice I'm trying to project into a nested typed structure. If I call .ToList () on x and y before Concat (), it works fine. As another point, one of my properties is an enumeration, but I assign it using the integer shell property.
, , , ? , ?
,