mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-01-06 08:46:34 +00:00
Support for loading of LazyLoaded properties via explicit join.
--HG-- extra : source : 1b7c96cb2a644ae17603c9d72ec09d94bc877bf1
This commit is contained in:
committed by
Mark McDowall
parent
4515c1d155
commit
935c26d03e
@@ -160,6 +160,14 @@ namespace Marr.Data
|
||||
get { return _children; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds an Child in the graph for LazyLoaded property.
|
||||
/// </summary>
|
||||
public void AddLazyRelationship(Relationship childRelationship)
|
||||
{
|
||||
_children.Add(new EntityGraph(childRelationship.RelationshipInfo.EntityType.GetGenericArguments()[0], this, childRelationship));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds an entity to the appropriate place in the object graph.
|
||||
/// </summary>
|
||||
@@ -182,7 +190,10 @@ namespace Marr.Data
|
||||
}
|
||||
else // RelationTypes.One
|
||||
{
|
||||
_relationship.Setter(_parent._entity, entityInstance);
|
||||
if (_relationship.IsLazyLoaded)
|
||||
_relationship.Setter(_parent._entity, Activator.CreateInstance(_relationship.MemberType, entityInstance));
|
||||
else
|
||||
_relationship.Setter(_parent._entity, entityInstance);
|
||||
}
|
||||
|
||||
EntityReference entityRef = new EntityReference(entityInstance);
|
||||
|
||||
Reference in New Issue
Block a user