Is it possible to do:
IEnumerable<MyModel> models = context.MyDBModels .Include(x => x.ConnectionA) .Select(x => new MyModel{ SomeData = new SomeDataClass { prop1 = x.ConnectionA.ConnectionB.prop1, prop2 = x.ConnectionA.ConnectionB.prop2, } }); when ConnectionB for example is null since null propagating operator is not possible in tree expressions like these.
I tested it and it looks like it works (it doesn't throw exceptions and in prop1/prop2 I have null as I want), but I want to be sure
Include, it is not needed when you have custom projection.