WCF RIA Services: Loading associated entities

Just a quick note to self: when you want to load associated entities in query you have to do it at two places,

1- in the query itself using the Include method

public IQueryable<MasterEntity> GetItems()
{
return this.ObjectContext.MasterItems.Include("DetailsEntities");
}


2- in the associated metadata class



 internal sealed class MasterEntityMetadata
{
private MasterEntityMetadata()
{
}

[Include]
public EntitySet<DetailsEntity> DetailsEntities;

}

Comments

Popular posts from this blog

Documentum DQL Query Custom Data Extension For SQL Server Reporting Services

Portable Class Library Projects and MVVM Light

Using taco to create Ionic projects for the Windows platform