Esempio n. 1
0
        public void Process(HttpContextBase context)
        {
            //Resolve all here
            ApiResponce            = Container.Resolve <IApiStandartResponce>();
            ApiManager             = Container.Resolve <IApiManager>();
            RouteContext           = new RequestContext(context, RouteData);
            ApiContext             = new ApiContext(RouteContext);
            ApiResponce.ApiContext = ApiContext;

            //NOTE: Don't register anything it will be resolved when needed
            //Container.RegisterInstance(ApiContext, new HttpContextLifetimeManager2(context));//Regiter only api context

            Method = ApiManager.GetMethod(((Route)RouteData.Route).Url, context.Request.RequestType);//Set method

            DoProcess(context);
        }
        public void Process(HttpContextBase context)
        {
            using (Container)
            {
                ApiManager   = Container.Resolve <IApiManager>();
                RouteContext = new RequestContext(context, RouteData);
                var config = Container.Resolve <IApiConfiguration>();
                ApiContext  = Container.Resolve <ApiContext>(new NamedParameter("requestContext", RouteContext), new NamedParameter("apiConfiguration", config));
                ApiResponce = Container.Resolve <IApiStandartResponce>();

                //NOTE: Don't register anything it will be resolved when needed
                //Container.RegisterInstance(ApiContext, new HttpContextLifetimeManager2(context));//Regiter only api context

                Method = ApiManager.GetMethod(((Route)RouteData.Route).Url, context.Request.RequestType);  //Set method

                DoProcess(context);
            }
        }