ContextGet Method (IEntityFactory, 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.ORMSupportClassesAssembly: SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.0.0.0 (5.0.0)
Syntax public virtual IEntity Get(
IEntityFactory factory,
params Object[] pkValues
)
Public Overridable Function Get (
factory As IEntityFactory,
ParamArray pkValues As Object()
) As IEntity
Parameters
- factory
- Type: SD.LLBLGen.Pro.ORMSupportClassesIEntityFactory
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:
IEntityEntity 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 Exception | Condition |
---|
ArgumentException | if more/less pkvalues are passed in as there are in the PK of the entity created with the factory passed in |
Remarks SelfServicing specific version
See Also