Loads all entities of type EntityType associated to a given entity by the given relation Relation.
You can choose which the fields to load.
If the role played by the associated type differs from EntityType, Role must be specified.
Namespace: Aspectize.CoreAssembly: AspectizeDAL (in AspectizeDAL.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
void LoadAssociatedFields<EntityType, Relation>( IEnumerable<string> fields, IEntity entity ) where EntityType : new(), Entity, IEntity, IDataWrapper where Relation : DataWrapper, IDataWrapper, IRelation |
| Visual Basic |
|---|
Sub LoadAssociatedFields(Of EntityType As {New, Entity, IEntity, IDataWrapper}, Relation As {DataWrapper, IDataWrapper, IRelation}) ( _ fields As IEnumerable(Of String), _ entity As IEntity _ ) |
Parameters
- fields
- Type: System.Collections.Generic..::..IEnumerable<(Of <(<'String>)>)>
The sequence of all field Names to load.
- entity
- Type: IEntity
The entity to begin with.
Type Parameters
- EntityType
- Type of Entity to load
- Relation
- Type of Relation to follow
Remarks
all fields that are not loaded must be nullable.
Examples
AdventureWorks.Production.ProductCategory productCategory = dm.GetEntity<AdventureWorks.Production.ProductCategory>(1); dm.LoadAssociatedFields<AdventureWorks.Production.ProductSubcategory, AdventureWorks.Production.ProductSubcategoryProductCategory>(new string[] { "Name" }, productCategory );
Dim productCategory As AdventureWorks.Production.ProductCategory = dm.GetEntity(Of AdventureWorks.Production.ProductCategory)(1) dm.LoadAssociatedFields(Of AdventureWorks.Production.ProductSubcategory, AdventureWorks.Production.ProductSubcategoryProductCategory)(New String() {"Name"}, productCategory)