This is driving me mad, I’ve got a DomainService call which on the server contains an Include() to return child objects as follows:
public IQueryable<RegionBorder> GetRegionBordersWithPolygonsAndLatLongs()
{
return this.ObjectContext.RegionBorders.Include("RegionPolygons.LatLongs");
}
I’ve set this line as a debug point on the server and it is generating the correct results with the child collections included within the toplevel entities. However, on the client, I cannot access the children. The client code is as follows:
EntityQuery<RegionBorder> query = idc.GetRegionBordersWithPolygonsAndLatLongsQuery();
LoadOperation<RegionBorder> lo = idc.Load<RegionBorder>(query);
lo.Completed += delegate(object sender, EventArgs e1)
{
//regionBorders = idc.RegionBorders;
string prtyName = "ProjOverspend";
var elements = new Collection<FrameworkElement>();
var propertySet = new ExtendedPropertySet();
propertySet.RegisterProperty(prtyName, prtyName, typeof(double), 0d);
foreach (RegionBorder ent in idc.RegionBorders)
{
foreach (RegionPolygon rp in ent.RegionPolygons)
{
Telerik.Windows.Controls.Map.MapPolygon mp = new Telerik.Windows.Controls.Map.MapPolygon();
mp.Points = rp.Points;
elements.Add(mp);
SetExtendedProperty(propertySet, prtyName, mp, 0d);
}
}
Can anybody help me with where I am going wrong because I am sure this was working fine before and now just will not do anything.
Thanks for any help.
Martyn.
You have to add IncludeAttribute in metadata as well.