コード例 #1
0
        public AspNetRequestData(RequestContext context, AspNetCurrentHttpRequest currentRequest)
        {
            /*
             *  1.) Route
             *  2.) Request
             *  3.) File
             *  4.) Header
             *  5.) RequestProperty
             */

            AddValues(new RouteDataValues(context.RouteData));

            var request = context.HttpContext.Request;

            addValues(RequestDataSource.Request, key => request[key], () => keysForRequest(request));

            var files = request.Files;

            addValues(RequestDataSource.File, key => files[key], () => files.AllKeys);

            Func <string, IEnumerable <string>, bool> ignoreCaseKeyFinder = (key, keys) => keys.Contains(key, StringComparer.InvariantCultureIgnoreCase);

            addValues(RequestDataSource.Cookie, key => request.Cookies[key].Value, () => request.Cookies.AllKeys, ignoreCaseKeyFinder);

            AddValues(new CookieValueSource(new Cookies.Cookies(currentRequest)));
            AddValues(new HeaderValueSource(currentRequest));

            AddValues(new RequestPropertyValueSource(request));
        }
コード例 #2
0
        public AspNetServiceArguments(RequestContext requestContext)
        {
            var currentRequest = new AspNetCurrentHttpRequest(requestContext.HttpContext.Request);

            With<IRequestData>(new AspNetRequestData(requestContext, currentRequest));
            With(requestContext.HttpContext);

            With<ICurrentHttpRequest>(currentRequest);

            With<IStreamingData>(new AspNetStreamingData(requestContext.HttpContext));

            With<IHttpWriter>(new AspNetHttpWriter(requestContext.HttpContext.Response));

            With<IClientConnectivity>(new AspNetClientConnectivity(requestContext.HttpContext.Response));

            With<IResponse>(new AspNetResponse(requestContext.HttpContext.Response));
        }
コード例 #3
0
        public AspNetServiceArguments(RequestContext requestContext)
        {
            var currentRequest = new AspNetCurrentHttpRequest(requestContext.HttpContext.Request);

            With <IRequestData>(new AspNetRequestData(requestContext, currentRequest));
            With(requestContext.HttpContext);


            With <ICurrentHttpRequest>(currentRequest);

            With <IStreamingData>(new AspNetStreamingData(requestContext.HttpContext));

            With <IHttpWriter>(new AspNetHttpWriter(requestContext.HttpContext.Response));

            With <IClientConnectivity>(new AspNetClientConnectivity(requestContext.HttpContext.Response));

            With <IResponse>(new AspNetResponse(requestContext.HttpContext.Response));
        }