Assembly: OptimaJet.Workflow.Core

Class TenantGlobalParameterApi

OptimaJet.Workflow.Core.Persistence.TenantGlobalParameterApi

Provides global parameter operations through an IPersistenceProvider for a tenant-specific or shared scope.

public sealed class TenantGlobalParameterApi

Constructors

public TenantGlobalParameterApi(IPersistenceProvider persistenceProvider, string? tenantId) #
Initializes a TenantGlobalParameterApi that uses the specified IPersistenceProvider and tenant scope.

Parameters

Name
Type
Description
persistenceProvider
IPersistenceProvider
The IPersistenceProvider used for global parameters.
tenantId
String
The tenant identifier. If null, empty, or composed only of white-space characters, the shared global parameter scope is used.

Exceptions

Type
Description
ArgumentNullException
persistenceProvider is null.

Properties

public string? TenantId { get; } #
Gets the tenant identifier that defines the global parameter scope.

Methods

public Task SaveAsync<T>(string type, string name, T value) #
Saves a global parameter value in the tenant-specific or shared scope represented by this instance.

Parameters

Name
Type
Description
type
String
The logical parameter type.
name
String
The parameter name.
value
{T}
The parameter value.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ArgumentNullException
type or name is null.
public Task<T> LoadAsync<T>(string type, string name) #
Loads a global parameter value from the tenant-specific or shared scope represented by this instance.

Parameters

Name
Type
Description
type
String
The logical parameter type.
name
String
The parameter name.

Returns

Type
Description
Task<T>
The parameter value, or the default value of T when no matching parameter exists.

Exceptions

Type
Description
ArgumentNullException
type or name is null.
public Task<Dictionary<string, T>> LoadWithNamesAsync<T>(string type, Sorting? sort = null) #
Loads the names and values of global parameters that have a logical type in the tenant-specific or shared scope represented by this instance.

Parameters

Name
Type
Description
type
String
The logical parameter type.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<String, T>
A mapping from parameter names to values.

Exceptions

Type
Description
ArgumentNullException
type is null.
public Task<List<T>> LoadValuesAsync<T>(string type, Sorting? sort = null) #
Loads the values of global parameters that have a logical type in the tenant-specific or shared scope represented by this instance.

Parameters

Name
Type
Description
type
String
The logical parameter type.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<List<T>>
The parameter values.

Exceptions

Type
Description
ArgumentNullException
type is null.
public Task<PagedResponse<T>> LoadWithPagingAsync<T>(string type, Paging paging, Sorting? sort = null) #
Loads a page of global parameter values that have a logical type from the tenant-specific or shared scope represented by this instance, together with the total matching count.

Parameters

Name
Type
Description
type
String
The logical parameter type.
paging
Paging
The Paging settings.
sort
Sorting
The optional Sorting settings.

Returns

Type
Description
Task<PagedResponse<T>>
A PagedResponse<T> containing the selected parameter values and total matching count.

Exceptions

Type
Description
ArgumentNullException
type is null.
public Task DeleteAsync(string type, string? name = null) #
Deletes global parameters of a logical type from the tenant-specific or shared scope represented by this instance, optionally limiting the deletion by parameter name.

Parameters

Name
Type
Description
type
String
The logical parameter type.
name
String
The parameter name to delete, or null to delete every parameter of the logical type.

Returns

Type
Description
Task
A Task that represents the asynchronous operation.

Exceptions

Type
Description
ArgumentNullException
type is null.