Show / Hide Table of Contents

Class NestedPersistFacade

Inheritance
Object
NestedPersist
NestedPersistFacade
SoRole
SoUser
SoUserCredential
EntityDetailsHelper<TParent, TChild>
RowForeignKeyHelper
MultiSave
NestedCollectionPersist
ModuleLicenseLinkBase<TLinkRow>
ModuleLicenseOwnerBase<TLink, TLinkRow>
Implements
INestedPersist
Inherited Members
NestedPersist._saveOwner
NestedPersist._isSaving
NestedPersist.SetSaveOwner(INestedPersist)
NestedPersist.Save()
NestedPersist.INestedPersist.OnPreIdUpdate()
NestedPersist.INestedPersist.OnPrimaryKeyRequest(PKContainer)
NestedPersist.INestedPersist.OnPrimaryKeyUpdate(PKContainer)
NestedPersist.INestedPersist.OnIdUpdate()
NestedPersist.INestedPersist.OnSave(BatchSave)
NestedPersist.INestedPersist.OnSaved(Boolean)
NestedPersist.IsSaving
NestedPersist.IsDeleted
NestedPersist.IsMarkedForDelete
NestedPersist.OnElementSaved
NestedPersist.OnElementIdUpdate
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
public abstract class NestedPersistFacade : NestedPersist, INestedPersist

Constructors

NestedPersistFacade()

Declaration
protected NestedPersistFacade()

Properties

IsDirty

Declaration
public override bool IsDirty { get; }
Property Value
Type Description
Boolean
Overrides
NestedPersist.IsDirty

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
NestedPersist.OnIdUpdate()

OnPreIdUpdate()

Allow for "fake id's" to be forced upon related objects.

Declaration
protected override void OnPreIdUpdate()
Overrides
NestedPersist.OnPreIdUpdate()
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
NestedPersist.OnPrimaryKeyRequest(PKContainer)
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
NestedPersist.OnPrimaryKeyUpdate(PKContainer)

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
NestedPersist.OnSave(BatchSave)

OnSaved(Boolean)

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
Boolean bSucceeded

True if the save operation succeeded and false if the save operation failed and rolled back.

Overrides
NestedPersist.OnSaved(Boolean)

Implements

INestedPersist

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top