Class SoftTrigger
Utility class for subscribing to changes in the database. The current implementation only handles changes made from this instance of NetServer.
Inherited Members
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(int, OnChange)
Subscribe to event raised after the update command is sent to the database.
Declaration
[Obsolete("This method is deprecated. Use SubscribeOnPostChange(string tableName, OnChange callback) instead.")]
public void SubscribeOnPostChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
int | tableNumber | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
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(int, OnChange)
Subscribe to event raised before the update command is sent to the database.
Declaration
[Obsolete("This method is deprecated. Use SubscribeOnPreChange(string tableName, OnChange callback) instead.")]
public void SubscribeOnPreChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
int | tableNumber | 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(int, OnChange)
Unsubscribe to event raised after the update command is sent to the database.
Declaration
[Obsolete("This method is deprecated. Use UnsubscribeOnPostChange(string tableName, OnChange callback) instead.")]
public void UnsubscribeOnPostChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
int | tableNumber | 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(int, OnChange)
Unsubscribe to event raised before the update command is sent to the database.
Declaration
[Obsolete("This method is deprecated. Use UnsubscribeOnPreChange(string tableName, OnChange callback) instead.")]
public void UnsubscribeOnPreChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
int | tableNumber | 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. |