Пример #1
0
        public async Task Invoke(IDictionary <string, object> environment)
        {
            var ctx = new OwinContext(environment);

            _options.OnIncomingRequest(ctx);
            await _next(environment);

            _options.OnOutgoingRequest(ctx);
        }
Пример #2
0
        /// <summary>
        /// Takes care of invoking the middleware
        /// </summary>
        /// <param name="environment">environment</param>
        /// <returns>Task</returns>
        public async Task Invoke(IDictionary <string, object> environment)
        {
            var ctx = new OwinContext(environment);

            //or use: var path = (string)environment["owin.RequestPath"];

            _options.OnIncomingRequest(ctx);
            await _next(environment);

            _options.OnOutgoingRequest(ctx);
        }