Class OperationHandler
Helpers for IOperationHandler<TInput, TResult>s.
public static class OperationHandler
- Inheritance
-
OperationHandler
- Inherited Members
Methods
Sync<TInput, TResult>(Func<OperationStartContext, TInput, Task<TResult>>)
Create a synchronous (start-only) operation from the given async lambda.
public static IOperationHandler<TInput, TResult> Sync<TInput, TResult>(Func<OperationStartContext, TInput, Task<TResult>> apply)
Parameters
applyFunc<OperationStartContext, TInput, Task<TResult>>Lambda that is invoked on each operation start.
Returns
- IOperationHandler<TInput, TResult>
Operation handler that only supports start with synchronous response.
Type Parameters
TInputOperation input type.
TResultOperation result type.
Sync<TInput, TResult>(Func<OperationStartContext, TInput, TResult>)
Create a synchronous (start-only) operation from the given lambda.
public static IOperationHandler<TInput, TResult> Sync<TInput, TResult>(Func<OperationStartContext, TInput, TResult> apply)
Parameters
applyFunc<OperationStartContext, TInput, TResult>Lambda that is invoked on each operation start.
Returns
- IOperationHandler<TInput, TResult>
Operation handler that only supports start with synchronous response.
Type Parameters
TInputOperation input type.
TResultOperation result type.
WrapAsGenericHandler(object, Type)
Wrap the given handler in a generic form.
public static IOperationHandler<object?, object?> WrapAsGenericHandler(object handler, Type interfaceType)
Parameters
handlerobjectAn instance of IOperationHandler<TInput, TResult> to wrap in a generic form.
interfaceTypeTypeIOperationHandler<TInput, TResult> type with its generic arguments.
Returns
- IOperationHandler<object, object>
A generic wrapper of the operation handler.
WrapAsGenericHandler<TInput, TResult>(IOperationHandler<TInput, TResult>)
Wrap the given handler in a generic form.
public static IOperationHandler<object?, object?> WrapAsGenericHandler<TInput, TResult>(IOperationHandler<TInput, TResult> handler)
Parameters
handlerIOperationHandler<TInput, TResult>Handler instance to wrap in a generic form.
Returns
- IOperationHandler<object, object>
A generic wrapper of the operation handler.
Type Parameters
TInputHandler input type.
TResultHandler output type.