Table of Contents

Interface IBusinessRuleContext

Namespace
GroupeIsa.Neos.Shared.Contexts
Assembly
GroupeIsa.Neos.Shared.dll

Represents the definition of the IBusinessRuleContext that encapsulates all specific information about an individual event rule.

public interface IBusinessRuleContext

Methods

AddOrUpdate<TValue>(string, Func<string, TValue>, Func<string, TValue, TValue>)

Adds a key/value pair if the key does not already exist, or updates a key/value pair if the key already exists.

TValue AddOrUpdate<TValue>(string key, Func<string, TValue> addValueFactory, Func<string, TValue, TValue> updateValueFactory) where TValue : notnull

Parameters

key string

The key to be added or whose value should be updated.

addValueFactory Func<string, TValue>

The function used to generate a value for an absent key.

updateValueFactory Func<string, TValue, TValue>

The function used to generate a new value for an existing key based on the key's existing value.

Returns

TValue

The new value for the key. This will be either be the result of addValueFactory (if the key was absent) or the result of updateValueFactory (if the key was present).

Type Parameters

TValue

The type of an argument to pass into addValueFactory and updateValueFactory.

TryAdd<TValue>(string, TValue)

Attempts to add the specified key and value to the dictionary.

bool TryAdd<TValue>(string key, TValue value) where TValue : notnull

Parameters

key string

The key of the element to add.

value TValue

The value of the element to add.

Returns

bool

true if the key/value pair was added to the dictionary successfully; otherwise, false.

Type Parameters

TValue

Type of the value to add.

TryGet<TValue>(string, out TValue?)

Attempts to get the value associated with the specified key.

bool TryGet<TValue>(string key, out TValue? value)

Parameters

key string

The key of the value to get.

value TValue

When this method returns, contains the object that has the specified key, or the default value of the type if the operation failed.

Returns

bool

true if the key was found; otherwise, false.

Type Parameters

TValue

Type of the value to get.

TryUpdate<TValue>(string, TValue, TValue)

Updates the value associated with key to newValue if the existing value with key is equal to comparisonValue.

bool TryUpdate<TValue>(string key, TValue newValue, TValue comparisonValue) where TValue : notnull

Parameters

key string

The key of the value that is compared with comparisonValue and possibly replaced.

newValue TValue

The value that replaces the value of the element that has the specified key if the comparison results in equality.

comparisonValue TValue

The value that is compared with the value of the element that has the specified key.

Returns

bool

true if the value with key was equal to comparisonValue and was replaced with newValue; otherwise, false.

Type Parameters

TValue

Type of the value to update.