Click or drag to resize
Context Class
General Context class which provides uniquing support for the object fetcher. A developer can use this class to create a space for objects where every entity is loaded just once.
Inheritance Hierarchy
SystemObject
  SD.LLBLGen.Pro.ORMSupportClassesContext

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.3.0.0 (5.3.0)
Syntax
public class Context

The Context type exposes the following members.

Constructors
  NameDescription
Public methodContext
Creates a new Context instance.
Public methodContext(Boolean)
Creates a new Context instance.
Protected methodContext(Boolean, Boolean)
Creates a new Context instance.
Top
Properties
  NameDescription
Protected propertyEntityTypeHashtables
Gets the entity type hashtables / dictionaries. Dictionaries which store per entity hash value, the entity's objectid
Protected propertyNewEntities
Gets the new entities.
Protected propertyObjectIDToEntityInstance
Gets the object ID to entity instance.
Public propertySetExistingEntityFieldsInGet
Gets / sets SetExistingEntityFieldsInGet flag. When set to false (default is true), an existing entity's fields is not set to the fields of the passed in entity. Fields are only set if the entity isn't dirty.
Top
Methods
  NameDescription
Public methodAdd(IEntityCollectionCore)
Adds the specified collection to this context. All contained entities are added to the context as well, if they're not already in the / a context. This will make sure that any entity added to the entity collection will be added to this context as well.
Public methodAdd(IEntityCore)
Adds the specified entity to the Context. If the passed in entity is already in a context, the Add is a no-op. Also if the entity isn't new and there is already an entity with the same PK values, the Add is a no-op.
Public methodClear
Clears this context. It removes all cached entity references from this context and also all type definitions. Per entity to remove, it calls OnRemove before the actual removal and OnRemoveComplete after the actual removal.
Public methodEntitySaveCommittedTEntity
After an entity has been saved and the transaction has been committed (or if no transaction was used: the entity was saved), this routine is called to move entities which are in the list of new entities and which are now saved to the store.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGet(IEntity)
The passed in entity is checked if the contained data is already in this / a context in another entity object. If that's the case, that entity object is returned. If the data is not in this context in another entity object, the passed in entity is returned and added to this context.
Public methodGet(IEntity2)
The passed in entity is checked if the contained data is already in this / a context in another entity object.
Public methodGet(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.
Public methodGet(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.
Public methodGetAll
Returns a readonly arraylist with all the objects of the type passed in which are currently stored in the internal object cache. No new entities are returned. If the type is not found, an empty array list is returned.
Public methodGetAllTypes
Gets all the Type objects for which objects are located in this Context
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnAddTEntity
Called at the start of Add(TEntity)
Protected methodOnAddCollection(IEntityCollection)
Called at the start of Add(IEntityCollection)
Protected methodOnAddCollection(IEntityCollection2)
Called at the start of Add(IEntityCollection2)
Protected methodOnAddCollectionComplete(IEntityCollection)
Called at the end of Add(IEntityCollection)
Protected methodOnAddCollectionComplete(IEntityCollection2)
Called at the end of Add(IEntityCollection2)
Protected methodOnAddCompleteTEntity
Called at the end of Add(TEntity)
Protected methodOnClear
Called at the start of the Clear() method
Protected methodOnClearComplete
Called at the end of the Clear() method
Protected methodOnInitComplete
Called at the end of the InitClass method, which initializes datastructures from the ctor
Protected methodOnRemove
Called at the start of the remove action for toRemove
Protected methodOnRemoveComplete
Called at the end of Remove(IEntityCore), when toRemove has been removed from this context
Public methodRemove
Removes the specified entity from the store
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also