views:

365

answers:

1

I have a databound grid at my view (XAML) and the Itemsource points to a ReportsCollection. The Reports entity has three primitives and some complex types. These three are shown as expected at datagrid. Additionally the Reports entity has a property of type Store. When loading Reports via GetReports domain method, I quickly figure out that only primitives are returned and not the whole graph of some depth. So, as I wanted to load the Store property too, I made this alteration at my domain service:

public IQueryable<Report> GetReports()
{
    return this.ObjectContext.Reports.Include("Store");
}

From what I see at the immediate window, store is loaded as expected, but when returned to client is still pruned. How can this be fixed?

Thank you!

+1  A: 

Decorate the Store property in the ReportMetadata class with [Include].

[MetadataTypeAttribute(typeof(Report.ReportMetadata))]
public partial class Report
{
    internal sealed class ReportMetadata
    {
        [Include]
        public Store Store;
    }
}
Kevin Hodges