ControllerBase Methods |
The ControllerBase type exposes the following members.
Name | Description | |
---|---|---|
![]() | BuildCacheKey |
Builds a cache key for use with GetFromCacheIfPresent.
The cache key is not hashed because we have experienced a collision using GetHashCode()
ie. the cache keys are quite long and there is a price in dictionary size in memory
and in dictionary lookups.
|
![]() | CheckObjectOperationSecurity |
Checks that the active user is allowed to perform an CRUD operation on a specific configuration object.
(note: except that a Create operation is not for a specific object).
Throws a SecurityException if not.
Method can be used for all configuration objects that are represented by a ConfigurationObjectType (except those that have a compound key).
Method checks auth role security as well as whether it is allowed to modify builtin/feature package objects.
|
![]() | CheckObjectSaveOperationSecurity |
Checks that the active user is allowed to Create a new - or Update an existing configuration object.
Throws a SecurityException if not.
Method can be used for all configuration objects that are represented by a ConfigurationObjectType (except those that have a compound key).
Method checks auth role security as well as whether it is allowed to modify builtin/feature package objects.
|
![]() | ConvertId(Int32, ConfigurationObjectType) |
Converts the integer id of an object to its transport-safe unique id (UId).
|
![]() | ConvertId(String, ConfigurationObjectType) |
Converts a string representation of an integer or Guid id to an integer id.
|
![]() | ConvertId(Guid, ConfigurationObjectType, Boolean) |
Converts the transport-safe unique id (UId) of an object to its integer id.
|
![]() | ConvertIds(IEnumerableGuid, ConfigurationObjectType) |
Converts the transport-safe unique ids (UId) of a number of objects to integer ids.
|
![]() | ConvertIds(IEnumerableInt32, ConfigurationObjectType) |
Converts the integer ids of a number of objects to their transport-safe unique ids (UId).
|
![]() | CreateCommand(SQLBuilder) | |
![]() | CreateCommand(String) | |
![]() | CreateSqlBulkCopy |
Create a new SqlBulkCopy instance using the connection, transaction and timeout values from the controller
|
![]() | DoInConnection(ControllerBaseActionWithNoResult) |
Executes an action that doesn't return a result. If no current connection exists, it will establish a connection to the database and close it afterwards.
An existing connection will be reused. Inside the action, the connection is available as DbConnection.
|
![]() | DoInConnection(ActionSqlConnection, SqlTransaction, Boolean) |
Executes an action that doesn't return a result. If no current connection exists, it will establish a connection to the database and close it afterwards.
Connection and Transaction are passed to delegate, to allow passing to other controllers
An existing connection will be reused. Inside the action, the connection is available as DbConnection.
To ensure a new connection set forceNew to true.
|
![]() | DoInConnectionT(ControllerBaseActionWithResultT) |
Executes an action and returns the result.
If no current connection exists, it will establish a connection to the database and close it afterwards.
An existing connection will be reused. Inside the action, the connection is available as DbConnection.
|
![]() | DoInTransaction(ControllerBaseActionWithNoResult) |
Executes an action (that doesn't return a result) in a transaction.
If no current connection and/or transaction exists, it will establish it and commit and close it afterwards.
An existing connection/transaction will be reused.
Inside the action, the connection is available as DbConnection and
the transaction as DbTransaction.
|
![]() | DoInTransactionT(ControllerBaseActionWithResultT) |
Executes an action in a transaction and returns the result.
If no current connection and/or transaction exists, it will establish it and commit and close it afterwards.
An existing connection/transaction will be reused.
Inside the action, the connection is available as DbConnection and
the transaction as DbTransaction.
|
![]() | DoInTransactionT(FuncSqlConnection, SqlTransaction, T, Boolean) |
Executes an action in a transaction and returns the result.
Connection and Transaction are passed to delegate, to allow passing to other controllers
If no current connection and/or transaction exists, it will establish it and commit and close it afterwards.
An existing connection/transaction will be reused. Set forceNew to true to ensure new connection and transaction
Inside the action, the connection is available as DbConnection and
the transaction as DbTransaction.
|
![]() | DoInTransactionUnlessPostponedDueToPreviousDefaultResultT |
The method can postpone a SQL transaction implemented by action if the method returns a default number, eg. 0.
If the the action method throws a SQL transitent error, then the next call to action is also postponed.
|
![]() | DoUnlessPostponedDueToPreviousDefaultResultT |
The method can postpone a method invocation if the previous call returned a default number, eg. 0.
|
![]() | ExecScalarResultQueryT |
Executes a query with a scalar result.
|
![]() | ExecuteMutexOperation(String, Action, Boolean) | |
![]() | ExecuteMutexOperationT(String, FuncT, Boolean) | |
![]() | ExpireCacheItem | |
![]() ![]() | FireAndLogEventHandlers |
Logs execution times for event handlers using System.Diagnostics
|
![]() | GetDbUTCNow | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultIntegerList, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultAppIdentity, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultBoolean, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultIListGuid, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultListGuid, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultListInt32, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultGuid, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultInt32, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultTimeZoneInfo, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresentT(String, ControllerBaseActionWithResultListT, ControllerBaseCacheOptions) | |
![]() | GetFromCacheIfPresentT(String, ControllerBaseActionWithResultT, ControllerBaseCacheOptions) |
Retrieves some data from the cache or (if it is not there) executes an action and stores the result in the cache.
Caching is not applied if the IgnoreCacheContext is used (depending on the parameter for it).
Note: caching should only be used with great care as there are a number of potential issues involved in using it!
|
![]() | GetNewRowIdentity | |
![]() | GetObjectDataVersion |
Gets the data version of an object.
|
![]() | IncrementDataVersion | |
![]() | IncrementObjectDataVersion(IEntityObject) |
Increments the data version of an entity object.
The data version is incremented in the db as well as on the object itself.
Method is used to update the data version of an object when an aggregated object is created/modified/deleted.
The purpose is to ensure that the id-based cache (in AppIdentity) is updated properly.
|
![]() | IncrementObjectDataVersion(Int32, EntityObjectType) |
Increments the data version of an entity object in the db.
Method is used to update the data version of an object when an aggregated object is created/modified/deleted.
The purpose is to ensure that the id-based cache (in AppIdentity) is updated properly.
|
![]() ![]() | LogEventExecutionTime |
If customer setting TraceEventExecutionTime is set, an entry is written to tblEventLog with the
execution time of an event handler.
Can be used to trace long running event handlers.
|
![]() ![]() | LogEventOnEntry |
If customer setting "TraceEventOnEntry" is set, an entry is written to tblEventLog.
Can be used to trace chains of event.
Endless chains of event can be detected by inspecting the recusion depth in the log.
|
![]() | PopulateTempTableT |
Creates a temporary db table with a single column and populates it with values.
|
![]() | PostponeTransientErrorT |
If the action throws a transient sql error, the exception is eaten.
An entry is written to the log with level Information.
The entire exception is written to the log with level Debug.
|
![]() | TransferUIdsToIdsLoadOption |
Converts/transfers one or more specified uids in a loadoptions object to ids.
The purpose is to enable caching as IEntityObjectsLoadOptions.IdList only works with ids (and not uids).
|
![]() | ValidateDataVersionT |
Validates that the data version of an object corresponds to the data version in the DB.
Method is used for validation before saving an object.
|
![]() ![]() | WaitForAsyncTaskT |
Use this to invoke and await and async operation
Function configures awaiter to avoid blocking operations
|
Name | Description | |
---|---|---|
![]() | ToBool |
Converts object to boolean.
(Defined by ObjectExtensions.) |
![]() | ToDateTime |
Converts object to DateTime.
(Defined by ObjectExtensions.) |
![]() | ToInt |
Converts object to integer.
(Defined by ObjectExtensions.) |