Class NestedPersistFacade
Inheritance
Implements
Inherited Members
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
public abstract class NestedPersistFacade : NestedPersist, INestedPersist
Constructors
NestedPersistFacade()
Declaration
protected NestedPersistFacade()
Properties
IsDirty
Is the object dirty?
Declaration
public override bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
GetFacadingItems()
Implement this method to expose items that needs to be persisted.
Declaration
protected abstract IEnumerable<INestedPersist> GetFacadingItems()
Returns
Type | Description |
---|---|
IEnumerable<INestedPersist> | Collection of items that needs to be persisted. |
OnIdUpdate()
Update related objects with correct id's to make sure that relations are consistent before saving to the database.
Declaration
protected override void OnIdUpdate()
Overrides
OnPreIdUpdate()
Allow for "fake id's" to be forced upon related objects.
Declaration
protected override void OnPreIdUpdate()
Overrides
Remarks
In order to figure out which objects taking part of the nested save operation that actually needs to be saved, this method allows for "fake id's" to be forced upon related objects. Upon receiving the "fake id", the objects receiving such an id can determine if they needs to be persisted (e.g. saved) to the database. However, the fake id's forced upon related objects must be set to correct id's in the OnIdUpdate method taking place later in the save operation.
OnPrimaryKeyRequest(PKContainer)
Allow the object to add itself to a collection of requests for primary keys.
Declaration
protected override void OnPrimaryKeyRequest(PKContainer pkContainer)
Parameters
Type | Name | Description |
---|---|---|
PKContainer | pkContainer | Collection of objects getting a primary key. |
Overrides
Remarks
When implementing this method, add yourself to the collection if you need a new primary key.
OnPrimaryKeyUpdate(PKContainer)
Update primary key.
Declaration
protected override void OnPrimaryKeyUpdate(PKContainer pkContainer)
Parameters
Type | Name | Description |
---|---|---|
PKContainer | pkContainer | Collection of objects getting a primary key. |
Overrides
OnSave(BatchSave)
Add the object to the collection of objects that are to be saved within the transaction.
Declaration
protected override void OnSave(BatchSave batchSave)
Parameters
Type | Name | Description |
---|---|---|
BatchSave | batchSave | An object holding all the objects that needs to be persisted. |
Overrides
OnSaved(bool)
Called after the save operation has completed. A boolean value is passed to notify whether or not the save operation succeeded. The complete save operation is rolled back if Save operation failed.
Declaration
protected override void OnSaved(bool bSucceeded)
Parameters
Type | Name | Description |
---|---|---|
bool | bSucceeded | True if the save operation succeeded and false if the save operation failed and rolled back. |