I am using 6.1.2.0. I hope you can tell me if I'm doing something wrong or if this is a bug (and if it is fixed in a later build).
The summary is: when I set a reference strategy to DoNotLoad for one navigation property on an entity, other navigation properties on that entity begin to misbehave.
My parent entity is called "Manual" it has child "Document" and "Author" entities. I have done the following in my singleton repository:
Manual.PropertyMetadata.Documents.ReferenceStrategy = new EntityReferenceStrategy(EntityReferenceLoadStrategy.DoNotLoad, MergeStrategy.OverwriteChanges);
I want to control the loading of Documents myself, however I want Authors to behave as a default reference. When I set the ReferenceStrategy for Documents, I get exceptions when I try to use PendingEntityListResolved event for Authors
public void LoadAuthorsAsync(Action<IEnumerable<Author>> onSuccess)
{
if (Authors.IsPendingEntityList)
{
Authors.PendingEntityListResolved += (s, e) => onSuccess(Authors); //THROWS EXCEPTION
}
else
{
onSuccess(Authors);
}
}
{System.ArgumentNullException: Value cannot be null.
Parameter name: member
at IdeaBlade.EntityModel.EntityQueriedEventArgs.get_Results()}
#region Authors property
/// <summary>Gets the Authors. </summary>
[Bindable(false)]
[Display(Name="Authors", AutoGenerateField=false)]
[DataMember]
public IbEm.RelatedEntityList<Author> Authors {
get { return PropertyMetadata.Authors.GetValue(this); } //LAST LINE IN DEBUGGER BEFORE EXCEPTION
}
#endregion Authors property