I'm having an impossible time figuring out why my returned child entities are null for a particular query:
The item has a child property with a 0 or 1 multiplicity called MetaDataItem
.
var res = ObjectContext.Contents.Include("MetaDataItem");
This works. I can confirm that res
contains 1 instance of MetaDataItem.
On the client:
var loadOperation = _cContext.Load(_cContext.GetItemQuery(itemId.Value)....
Content item = _cContext.Contents.First(c => c.ContentId == itemId.Value);
Here item.MetaDataItem
is null
instead of containing the one instance.
Here is the metadata class (note that I DO have an include attribute):
[MetadataTypeAttribute(typeof(Content.ContentMetadata))]
public partial class Content
{
internal sealed class ContentMetadata
{
[Include]
public MetaDataItem MetaDataItem { get; set; }
}
}
So, why isn't my object populating? What else should I be looking at? Unfortunately, this appears to be where the magic
of RIA services occurs, so I can't even really get a handle on attempting to debug the issue. Any help would be most appreciated.