Click or drag to resize

IEntity2 Interface

Interface used for all Entity2 classes Adapter specific

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.8.0.0 (5.8.21.0111)
Syntax
public interface IEntity2 : IEntityCore, 
	IEditableObject, IActiveContextParticipant, ITransactionalElement

The IEntity2 type exposes the following members.

Properties
  NameDescription
Public propertyActiveContext
Gets / sets the active context this object is in. Setting this property is not adding the object to the context, it will make contained entities be added to the passed in context. If the object is already in a context, setting this property has no effect. Setting this property is done by framework code, use the Context's Add/Get methods to work with contexts and entities.
(Inherited from IActiveContextParticipant.)
Public propertyAuditorToUse
Gets or sets the Auditor for this entity.
(Inherited from IEntityCore.)
Public propertyAuthorizerToUse
Gets or sets the Authorizer for this entity.
(Inherited from IEntityCore.)
Public propertyConcurrencyPredicateFactoryToUse
Gets / sets the IConcurrencyPredicateFactory to use for GetConcurrencyPredicate(ConcurrencyPredicateType).
(Inherited from IEntityCore.)
Public propertyCustomPropertiesOfType
The custom properties for the type of this entity instance.
(Inherited from IEntityCore.)
Public propertyFields
The internal presentation of the data, which is an EntityFields2 object, which implements IEntityFields2.
Public propertyFieldsCustomPropertiesOfType
The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs.
(Inherited from IEntityCore.)
Public propertyIsDeserializing
Returns true if this entity instance is in the middle of a deserialization process, for example during a ReadXml() call. For internal use only.
(Inherited from IEntityCore.)
Public propertyIsDirty
Marker for the entity object if the object is 'dirty' (changed, true) or not (false). Affects/reads .Fields.IsDirty.
(Inherited from IEntityCore.)
Public propertyIsNew
Marker for the entity object if the object is new and should be inserted when saved (true) or read from the database (false).
(Inherited from IEntityCore.)
Public propertyIsUpdateOnlyEntity
Gets a value indicating whether this instance is an update only entity. UpdateOnly entities are entities which are 'split off' from the main entity and only update rows in the database, never insert rows.
(Inherited from IEntityCore.)
Public propertyCode exampleLLBLGenProEntityName
Returns the full name for this entity, which is important for the DAO to find back persistence info for this entity.
(Inherited from IEntityCore.)
Public propertyLLBLGenProEntityTypeValue
Returns the EntityType enum value for this entity.
(Inherited from IEntityCore.)
Public propertyLLBLGenProIsInHierarchyOfType
Gets the type of the hierarchy this entity is in.
(Inherited from IEntityCore.)
Public propertyMarkedForDeletion
flag which is set when the entity is removed from an entity collection and added to a tracker.
(Inherited from IEntityCore.)
Public propertyObjectID
Gets / sets the unique Object ID which is created at runtime when the entity is instantiated. Can be used for external caches.
(Inherited from IEntityCore.)
Public propertyParticipatesInTransaction
Flag to check if the ITransactionalElement implementing object is participating in a transaction or not.
(Inherited from ITransactionalElement.)
Public propertyPrimaryKeyFieldInfos
Gets the primary key field infos. Similar to PrimaryKeyFields, but this property doesn't trigger field creation.
(Inherited from IEntityCore.)
Public propertyPrimaryKeyFields
List of IEntityField2 references which form the primary key. Reads/Affects .Fields.PrimaryKeyFields
Public propertyTransaction
The ITransaction this ITransactionalElement implementing object is participating in. Only valid if ParticipatesInTransaction is true. If set to null, the ITransactionalElement is no longer participating in a transaction.
(Inherited from ITransactionalElement.)
Public propertyTypeDefaultValueProviderToUse
Gets or sets the TypeDefaultValue provider to use. This object is used to provide default values for value typed fields which are null and not of type Nullable(Of T)
(Inherited from IEntityCore.)
Public propertyValidator
The validator object used to validate the entity on several moments in the entity's life.
(Inherited from IEntityCore.)
Top
Methods
  NameDescription
Public methodAcceptChanges
Accepts the changes made to the fields. Used in databinding/service scenarios. Calls AcceptChange on the fields in this entity
(Inherited from IEntityCore.)
Public methodBeginEdit
Begins an edit on an object.
(Inherited from IEditableObject.)
Public methodCancelEdit (Inherited from IEditableObject.)
Public methodCheckIfEntityHasPendingFkSyncsTEntity
Checks whether this instance has pending fk syncs. A pending FK sync is a sync which hasn't been used yet. If an entity has pending FK syncs, it has to be included into a save queue. Only syncs with entities in the passed in queue are considered. If a sync is with an entity which isn't in the passed in queue, the sync isn't honoured anyway, so the fk sync can be ignored.
(Inherited from IEntityCore.)
Public methodCheckIfIsSubTypeOf
Determines whether this entity is a subType of the entity represented by the passed in enum value, which represents a value in the EntityType enum
(Inherited from IEntityCore.)
Public methodDetachFromGraph
Detaches this entity from all referencing entities and resets all references in this entity to other entities, including many-to-many relationships.
Public methodDiscardSavedFields
Removes all saved field sets from the internal hashtable, clearing up space. This method is also called when an entity is saved.
(Inherited from IEntityCore.)
Public methodEndEdit (Inherited from IEditableObject.)
Public methodFlagAsSaved
Method which will fire the AfterSave event to signal that this entity is persisted and refetched succesfully.
(Inherited from IEntityCore.)
Public methodFlagMeAsChanged
Routine which will flag all subscribers of the EntityContentsChanged event that this entity's contents is changed.
(Inherited from IEntityCore.)
Public methodGetAllRelations
Gets a list of all the EntityRelation objects the type of this instance has.
(Inherited from IEntityCore.)
Public methodGetConcurrencyPredicate
Creates the requested predicate of the type specified. If no IConcurrencyPredicateFactory instance is stored in this entity instance, null is returned.
(Inherited from IEntityCore.)
Public methodGetCurrentFieldValue
Gets the current value of the EntityField with the index fieldIndex. Will refetch the complete entity's fields from the database if necessary (i.e. the entity is outofsync.).
(Inherited from IEntityCore.)
Public methodGetDependentRelatedEntities
Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These entities will have to be persisted before this entity during a recursive save.
Public methodGetDependingRelatedEntities
Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.
Public methodGetEntityDescription(Boolean)
Gets the entity description. This string is used in verbose trace messages. It will produce "EntityCore", if the passed in switch flag is false, to prevent performance loss due to reflection activity for trace results which will never be seen.
(Inherited from IEntityCore.)
Public methodGetEntityDescription(Boolean, IEntityCore)
Gets the entity description. This string is used in verbose trace messages. It will produce "EntityCore", if verbose tracing is switched off for the GeneralSwitch, to prevent performance loss due to reflection activity for trace results which will never be seen.
(Inherited from IEntityCore.)
Public methodGetEntityFactory
Returns a new ready to use factory for the type of this instance.
Public methodGetFieldByName
Helper method which performs a lookup in the fields based on the name specified.
(Inherited from IEntityCore.)
Public methodGetInheritanceInfo
Gets the inheritance info for this entity, if applicable (it's then overriden) or null if not.
(Inherited from IEntityCore.)
Public methodGetInheritanceInfoProvider
Gets the inheritance info provider instance of the project this entity instance is located in.
(Inherited from IEntityCore.)
Public methodGetMemberEntityCollections
Gets a list of all entity collections stored as member variables in this entity. The contents of the list is used by the DataAccessAdapter to perform recursive saves. Only 1:n related collections are returned.
Public methodGetRelatedData
Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.
(Inherited from IEntityCore.)
Public methodGetRelationsForFieldOfType
Gets the relation objects which represent the relation the fieldName specified is mapped on.
(Inherited from IEntityCore.)
Public methodReadXml(String)
Will fill the entity and its containing members (recursively) with the data stored in the Xml string passed in. The string xmlData has to be filled with Xml in the format written by IEntity.WriteXml() and the Xml has to be compatible with the structure of this entity.
(Inherited from IEntityCore.)
Public methodReadXml(XmlNode)
Will fill the entity and its containing members (recursively) with the data stored in the XmlNode passed in. The XmlNode has to be filled with Xml in the format written by IEntity.WriteXml() and the Xml has to be compatible with the structure of this entity.
(Inherited from IEntityCore.)
Public methodRejectChanges
Rejects the changes made to the fields. Used in databinding/service scenarios. Calls RejectChange on the fields in this entity
(Inherited from IEntityCore.)
Public methodRollbackFields
Replaces the current set of fields with the fields saved under the name specified. If no set of fields is found with the name specified an exception is thrown. Removes the entry after a succesful rollback.
(Inherited from IEntityCore.)
Public methodSaveFields
Saves the current set of fields under the name specified in an internal hashtable. All data inside the field objects is preserved. If there is already a set of fields saved under the name specified, that set of fields is overwritten.
(Inherited from IEntityCore.)
Public methodSetEntityError
Sets the error message which is returned by IDataErrorInfo.Error
(Inherited from IEntityCore.)
Public methodSetEntityFieldError
Sets the error message for the field specified. If there's already a message stored for this field, it's overwritten unless append is set to true, which appends the message to the existing error using a semi-colon as separator. The message stored is returned by IDataErrorInfo[fieldName];
(Inherited from IEntityCore.)
Public methodSetNewFieldValue(Int32, Object)
Sets the EntityField on index fieldIndex to the new value value. Marks also the entityfields as dirty. Will refetch the complete entity's fields from the database if necessary (i.e. the entity is outofsync.).
(Inherited from IEntityCore.)
Public methodSetNewFieldValue(String, Object)
Sets the EntityField with the name fieldName to the new value value. Marks also the entityfields as dirty. Will refetch the complete entity's fields from the database if necessary (i.e. the entity is outofsync.).
(Inherited from IEntityCore.)
Public methodSetRelatedEntity
Sets the internal parameter related to the fieldname passed to the instance relatedEntity.
(Inherited from IEntityCore.)
Public methodSetRelatedEntityProperty
Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.
(Inherited from IEntityCore.)
Public methodTestCurrentFieldValueForNull
Returns true if the current value for the field with the fieldIndex passed in represents null/not defined, false otherwise. Should not be used for testing if the original value (read from the db) is NULL
(Inherited from IEntityCore.)
Public methodTestOriginalFieldValueForNull
Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, false otherwise. Should not be used for testing if the current value is NULL, use TestCurrentFieldValueForNull(Enum) for that.
(Inherited from IEntityCore.)
Public methodTransactionCommit
When the ITransaction in which this element participates is commited, this element can succesfully finish actions performed by this element. This method is called by ITransaction, you should not call it by yourself. When this element doesn't participate in a transaction it finishes the actions itself, calling this method is not needed.
(Inherited from ITransactionalElement.)
Public methodTransactionRollback
When the ITransaction in which this element participates is rolled back, this element has to roll back its internal variables. This method is called by ITransaction, you should not call it by yourself.
(Inherited from ITransactionalElement.)
Public methodUnsetRelatedEntity(IEntityCore, String)
Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity()
(Inherited from IEntityCore.)
Public methodUnsetRelatedEntity(IEntityCore, String, Boolean)
Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity()
(Inherited from IEntityCore.)
Public methodValidateEntity
General validation method which isn't used by the LLBLGen Pro framework, but can be used by your own code to validate an entity at any given moment.
(Inherited from IEntityCore.)
Public methodWriteXml(String)
Converts the data inside inside this entity into XML, recursively.
(Inherited from IEntityCore.)
Public methodWriteXml(XmlWriter, XmlFormatAspect)
Converts this entity to XML
Public methodWriteXml(String, String)
Converts the data inside inside this entity into XML, recursively.
(Inherited from IEntityCore.)
Public methodWriteXml(XmlDocument, XmlNode)
Converts the data inside inside this entity into XML, recursively.
(Inherited from IEntityCore.)
Public methodWriteXml(XmlFormatAspect, String)
Converts this entity to XML, recursively.
(Inherited from IEntityCore.)
Public methodWriteXml(XmlWriter, XmlFormatAspect, String)
Converts this entity to XML
Public methodWriteXml(String, XmlDocument, XmlNode)
Converts the data inside inside this entity into XML, recursively.
(Inherited from IEntityCore.)
Public methodWriteXml(XmlFormatAspect, String, String)
Converts this entity to XML, recursively.
(Inherited from IEntityCore.)
Public methodWriteXml(XmlFormatAspect, XmlDocument, XmlNode)
Converts this entity to XML, recursively. Uses the LLBLGenProEntityName for the rootnode name
(Inherited from IEntityCore.)
Public methodWriteXml(XmlWriter, XmlFormatAspect, String, DictionaryGuid, IEntityCore)
Converts this entity to XML
Public methodWriteXml(XmlFormatAspect, String, XmlDocument, XmlNode)
Converts this entity to XML, recursively.
(Inherited from IEntityCore.)
Top
Events
  NameDescription
Public eventAfterSave
Event handler declaration for the event that is raised each time this entity is persisted. Related entities can subscribe to this event to start housekeeping actions, like syncing internal FK fields with the PK fields of this entity.
(Inherited from IEntityCore.)
Public eventEntityContentsChanged
Event handler declaration for the event that is raised each time the one of values of this entity are changed. The event does not contain the value / field which is changed, it only signals subscribers the entity is changed and the subscriber should act accordingly, f.e. fire a ListChanged event.
(Inherited from IEntityCore.)
Public eventInitialized
Event which is raised at the end of the initialization routine of the entity. This event is also raised if the entity is pre-filled with a filled EntityFields(2) object. In your handler, check the State property of the entity Fields to see if you're dealing with a new entity or with an entity which is new, but pre-initialized with filled field objects.
(Inherited from IEntityCore.)
Public eventInitializing
Event which is raised at the start of the initialization routine of the entity. The entity is clean and has no entity fields object yet.
(Inherited from IEntityCore.)
Public eventPropertyChanged
Event fired when a field / property is changed. To fire this event from a derived class, call OnPropertyChanged.
(Inherited from IEntityCore.)
Top
See Also