-1
有没有办法急于加载在查询中获取的实体的子集合,而无需在Expand
方法中指定集合的路径为string
?在查询执行期间急切地加载收集属性
目前,我有以下几点:
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
}
}
有什么办法避免把string
S IN的.Expand
方法,或者是反映在我的代码我唯一的,以避免产生复制/粘贴未经检查的编译器的脆弱性?