Method CreateRunnerWithExclusiveService
- Namespace
- MVVrus.AspNetCore.ActiveSession
- Assembly
- MVVrus.AspNetCore.ActiveSession.dll
CreateRunnerWithExclusiveService<TRequest, TResult>(IActiveSession, TRequest, HttpContext, IDisposable)
Create a new runner that uses an exlusively accessible service.
public static KeyedRunner<TResult> CreateRunnerWithExclusiveService<TRequest, TResult>(this IActiveSession Session, TRequest Request, HttpContext Context, IDisposable ExclusiveServiceAccessor)
Parameters
Session
IActiveSessionThe CreateRunner<TRequest, TResult>(TRequest, HttpContext) instance for which the method to be perormed.
Request
TRequest- Data to be passed as a parameter to the runner's constructor to create the runner.
Context
HttpContext- Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor
IDisposableThe accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container.
Returns
- KeyedRunner<TResult>
A structure that contains the reference to the new runner and its number within the active session.
Type Parameters
TRequest
Type of the data used to create a new runner. TResult
Type of the result, returned by the runner.