Performs specified action on lock associated with dashboard type and user.
If lock cannot be acquired within a short time because another task is running concurrently on the lock, method throws an exception InvalidOperationException.
The lock is released even if specified method threw an exception, after which exception is thrown outside.
public Task<T> ExecuteInLockAsync<T>(
Guid userID,
DashboardType dashboardType,
Func<IDbScope, CancellationToken, Task<T>> actionAsync,
CancellationToken cancellationToken = default
)
Public Function ExecuteInLockAsync(Of T) (
userID As Guid,
dashboardType As DashboardType,
actionAsync As Func(Of IDbScope, CancellationToken, Task(Of T)),
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of T)public:
generic<typename T>
virtual Task<T>^ ExecuteInLockAsync(
Guid userID,
DashboardType dashboardType,
Func<IDbScope^, CancellationToken, Task<T>^>^ actionAsync,
CancellationToken cancellationToken = CancellationToken()
) sealedabstract ExecuteInLockAsync :
userID : Guid *
dashboardType : DashboardType *
actionAsync : Func<IDbScope, CancellationToken, Task<'T>> *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> Task<'T>
override ExecuteInLockAsync :
userID : Guid *
dashboardType : DashboardType *
actionAsync : Func<IDbScope, CancellationToken, Task<'T>> *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> Task<'T>