Is there a way to eagerly load the child collections of entities fetched in a query without having to specify the paths of the collections as strings in the Expand method?
Currently I have the following:
foo_entities ctx = new foo_entities(new Uri("http://url/FooService.svc/"));
ctx.MergeOption = MergeOption.AppendOnly;
var things = ctx.Things
.Expand("ChildCollectionProperty1," +
"..." +
"ChildCollectionPropertyN");
foreach (var item in things)
{
foreach (var child in item.ChildCollectionProperty1)
{
//do thing
}
}
Is there any way to avoid putting strings in the .Expand method, or is reflection my only out to avoid creating copy/paste unchecked by compiler fragility in my code?