示例#1
0
        private static DummyResponseFeature GetResponse()
        {
            var feature = new DummyResponseFeature
            {
                Headers = new HeaderDictionary()
            };

            return(feature);
        }
示例#2
0
        private static (HttpContext, RequestDelegate) GetOnStartingResponseAwareContext()
        {
            DummyResponseFeature feature = GetResponse();

            var context = new DefaultHttpContext();

            context.Features.Set <IHttpResponseFeature>(feature);

            async Task next(HttpContext ctx)
            {
                await feature.InvokeCallBack();
            }

            return(context, (RequestDelegate)next);
        }