DataAccessAdapterCoreFetchNewEntityTEntity Method (IRelationPredicateBucket, IPrefetchPath2, Context, ExcludeIncludeFieldsList) |
Fetches a new entity using the filter/relation combination filter passed in via filterBucket and the new entity is created using the
specified generic type. Use this method when fetching a related entity using a current entity (for example, fetch the related Customer entity of an existing Order entity)
Namespace:
SD.LLBLGen.Pro.ORMSupportClasses
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.10.0.0 (5.10.0)
Syntax public TEntity FetchNewEntity<TEntity>(
IRelationPredicateBucket filterBucket,
IPrefetchPath2 prefetchPath,
Context contextToUse,
ExcludeIncludeFieldsList excludedIncludedFields
)
where TEntity : new(), EntityBase2, IEntity2
Public Function FetchNewEntity(Of TEntity As {New, EntityBase2, IEntity2}) (
filterBucket As IRelationPredicateBucket,
prefetchPath As IPrefetchPath2,
contextToUse As Context,
excludedIncludedFields As ExcludeIncludeFieldsList
) As TEntity
Parameters
- filterBucket
- Type: SD.LLBLGen.Pro.ORMSupportClassesIRelationPredicateBucket
the completely filled in IRelationPredicateBucket object which will be used as a filter for the fetch. The fetch
will only load the first entity loaded, even if the filter results into more entities being fetched - prefetchPath
- Type: SD.LLBLGen.Pro.ORMSupportClassesIPrefetchPath2
The prefetch path to use for this fetch, which will fetch all related entities defined by the path as well. - contextToUse
- Type: SD.LLBLGen.Pro.ORMSupportClassesContext
The context to add the entity to if the fetch was succesful, and before the prefetch path is fetched. This ensures
that the prefetch path is fetched using the context specified and will re-use already loaded entity objects. - excludedIncludedFields
- Type: SD.LLBLGen.Pro.ORMSupportClassesExcludeIncludeFieldsList
The list of IEntityField2 objects which have to be excluded or included for the fetch.
If null or empty, all fields are fetched (default). If an instance of ExcludeIncludeFieldsList is passed in and its ExcludeContainedFields property
is set to false, the fields contained in excludedIncludedFields are kept in the query, the rest of the fields in the query are excluded.
Type Parameters
- TEntity
- The type of entity to fetch
Return Value
Type:
TEntityThe new entity fetched, or a previous entity fetched if that entity was in the context specified
Implements
IDataAccessAdapterFetchNewEntityTEntity(IRelationPredicateBucket, IPrefetchPath2, Context, ExcludeIncludeFieldsList)Remarks TEntity can't be a type which is an abstract entity. If you want to fetch an instance of an abstract entity (e.g. polymorphic fetch)
please use the overload which accepts an entity factory instead
See Also