Show / Hide Table of Contents

Class SoftTrigger

Utility class for subscribing to changes in the database. The current implementation only handles changes made from this instance of NetServer.

Inheritance
object
SoftTrigger
Inherited Members
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
[SoInject("Database")]
public class SoftTrigger

Constructors

SoftTrigger(ISoftTriggerPlugin[])

Constructur used for unit-testing SoftTrigger and SoftTrigger-plugin implementations.

Declaration
public SoftTrigger(ISoftTriggerPlugin[] plugins)
Parameters
Type Name Description
ISoftTriggerPlugin[] plugins

Methods

HasSubscribers(string)

Check if any pre or post change subscribers are registered for a given table.

Declaration
public bool HasSubscribers(string tableName)
Parameters
Type Name Description
string tableName

Table name

Returns
Type Description
bool

SubscribeOnPostChange(string, OnChange)

Subscribe to event raised after the update command is sent to the database.

Declaration
public void SubscribeOnPostChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type Name Description
string tableName

Table subscribing to modifications for.

SoftTrigger.OnChange callback

Callback called when modifications in the database is carried out.

SubscribeOnPreChange(string, OnChange)

Subscribe to event raised before the update command is sent to the database.

Declaration
public void SubscribeOnPreChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type Name Description
string tableName

Table subscribing to modifications for.

SoftTrigger.OnChange callback

Callback called when modifications in the database is carried out.

UnsubscribeOnPostChange(string, OnChange)

Unsubscribe to event raised after the update command is sent to the database.

Declaration
public void UnsubscribeOnPostChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type Name Description
string tableName

Table subscribing to modifications for.

SoftTrigger.OnChange callback

Callback called when modifications in the database is carried out.

UnsubscribeOnPreChange(string, OnChange)

Unsubscribe to event raised before the update command is sent to the database.

Declaration
public void UnsubscribeOnPreChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type Name Description
string tableName

Table subscribing to modifications for.

SoftTrigger.OnChange callback

Callback called when modifications in the database is carried out.

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