Пример #1
0
        /// <inheritdoc />
        public Task InvokeAsync(DispatchMiddlewareContext context, Func <Task> next)
        {
            var customInstance = OrchestrationInstanceEx.Get(context.GetProperty <OrchestrationInstance>());

            context.SetProperty <OrchestrationInstance>(customInstance);

            // Do something with the session data, such as starting a logging scope with correlation id property.

            return(next());
        }
Пример #2
0
        /// <inheritdoc />
        public Task InvokeAsync(DispatchMiddlewareContext context, Func <Task> next)
        {
            // Initialize the OrchestrationInstance with our session data. Or if it already exists,
            // then set it to the appropriate context properties.
            OrchestrationRuntimeState runtimeState = context.GetProperty <OrchestrationRuntimeState>();
            var customInstance = OrchestrationInstanceEx.Initialize(runtimeState);

            context.SetProperty <OrchestrationInstance>(customInstance);

            // Do something with the session data, such as starting a logging scope with correlation id property.

            return(next());
        }