Loads an entity of the given type EntityType specified by its id. The id can be a simple or multipart value.
You can choose which the fields to load.
Namespace: Aspectize.CoreAssembly: AspectizeDAL (in AspectizeDAL.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
void LoadEntityFields<EntityType>( IEnumerable<string> fields, Object id, params Object[] otherIdParts ) where EntityType : new(), Entity, IEntity, IDataWrapper |
| Visual Basic |
|---|
Sub LoadEntityFields(Of EntityType As {New, Entity, IEntity, IDataWrapper}) ( _ fields As IEnumerable(Of String), _ id As Object, _ ParamArray otherIdParts As Object() _ ) |
Parameters
- fields
- Type: System.Collections.Generic..::..IEnumerable<(Of <(<'String>)>)>
The sequence of all field Names to load.
- id
- Type: System..::..Object
Either a simple value or the first part of a multipart value.
- otherIdParts
- Type: array<System..::..Object>[]()[][]
The second and onwards parts of a multipart value.
Type Parameters
- EntityType
- Type of Entity to load
Remarks
all fields that are not loaded must be nullable.
Examples
dm.LoadEntityFields<AdventureWorks.Production.ProductCategory>(new string[] { "Name" }, 3);
dm.LoadEntityFields(Of AdventureWorks.Production.ProductCategory)(New String() {"Name"}, 3)