Click or drag to resize

ContextGet Method (IEntityFactory2, Object)

Tries to find an entity with the same PK values as passed in. The PK values have to be in the same order as they appear in the constructor of the entity. If an entity in the context has the same PK values, that entity is returned, otherwise a new entity is returned, created with the factory passed in, with its PK values initialized, though not fetched.

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.7.0.0 (5.7.0)
Syntax
public virtual IEntity2 Get(
	IEntityFactory2 factory,
	params Object[] pkValues
)

Parameters

factory
Type: SD.LLBLGen.Pro.ORMSupportClassesIEntityFactory2
Factory to use for entity to find
pkValues
Type: SystemObject
Pk values. Have to be specified in the same order as the PK fields in the entity constructor created by the factory passed in.

Return Value

Type: IEntity2
Entity with the same PK values if that entity was already added to the context, or a new entity if no entity was previously added to this context with the same PK values
Exceptions
ExceptionCondition
ArgumentExceptionif more/less pkvalues are passed in as there are in the PK of the entity created with the factory passed in
Remarks
Adapter specific version
See Also