Loads entities following a coherent graph of relations related to a given entity of type EntityType. Only single value fields are loaded. Multivalue or temporal fields are not loaded. For loading of multivalue or temporal fields please refer to LoadEntitiesGraphFields methods.

Namespace: Aspectize.Core
Assembly: AspectizeDAL (in AspectizeDAL.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
void LoadEntitiesGraph<EntityType>(
	IEnumerable<IRoleRelationQuery> roleRelations,
	IEntity entity
)
where EntityType : new(), Entity, IEntity, IDataWrapper
Visual Basic
Sub LoadEntitiesGraph(Of EntityType As {New, Entity, IEntity, IDataWrapper}) ( _
	roleRelations As IEnumerable(Of IRoleRelationQuery), _
	entity As IEntity _
)

Parameters

roleRelations
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'IRoleRelationQuery>)>)>
The ordered and complete sequence of relations and roles to follow.
entity
Type: IEntity
The entity to begin with.

Type Parameters

EntityType
Type of Entity to load

Examples

CopyC#
AdventureWorks.Production.ProductCategory category = dm.GetEntity<AdventureWorks.Production.ProductCategory>(3);

List<IRoleRelationQuery> roleRelations = new List<IRoleRelationQuery>();

roleRelations.Add(new RoleRelationQuery<AdventureWorks.Production.ProductCategory, AdventureWorks.Production.ProductSubcategoryProductCategory>());
roleRelations.Add(new RoleRelationQuery<AdventureWorks.Production.ProductSubcategory, AdventureWorks.Production.ProductProductSubcategory>());

dm.LoadEntitiesGraph<AdventureWorks.Production.ProductCategory>(roleRelations, category);
CopyVB.NET
Dim category As AdventureWorks.Production.ProductCategory = dm.GetEntity(Of AdventureWorks.Production.ProductCategory)(3)

Dim roleRelations As List(Of IRoleRelationQuery) = New List(Of IRoleRelationQuery)()

roleRelations.Add(New RoleRelationQuery(Of AdventureWorks.Production.ProductCategory, AdventureWorks.Production.ProductSubcategoryProductCategory)())
roleRelations.Add(New RoleRelationQuery(Of AdventureWorks.Production.ProductSubcategory, AdventureWorks.Production.ProductProductSubcategory)())

dm.LoadEntitiesGraph(Of AdventureWorks.Production.ProductCategory)(roleRelations, category)

See Also