Example #1
0
        public override void Configure(Container container)
        {
            //ServiceStack.Text.JsConfig.EmitCamelCaseNames = true; ! DO NOT USE THIS !
            //Feature disableFeatures = Feature.Xml | Feature.Jsv | Feature.Csv | Feature.Soap11 | Feature.Soap12 | Feature.Soap;
            SetConfig(new EndpointHostConfig
            {
                DebugMode = false,
                UseCustomMetadataTemplates = true,
                DefaultContentType         = ContentType.Json,
                EnableFeatures             = Feature.Json | Feature.Metadata
                                             //ServiceStackHandlerFactoryPath  = "api"
            });
            CorsFeature cf = new CorsFeature(allowedOrigins: "*", allowedMethods: "GET, POST, PUT, DELETE", allowedHeaders: "Content-Type, Signature", allowCredentials: false);

            this.Plugins.Add(cf);

            string strConnectionString = GetConnectionString();
            var    dbConnectionFactory = new OrmLiteConnectionFactory(strConnectionString, SqlServerDialect.Provider)
            {
                ConnectionFilter =
                    x =>
                    new ProfiledDbConnection(x, Profiler.Current)
            };

            container.Register <IDbConnectionFactory>(dbConnectionFactory);

            var connectString = new TmsWS.ServiceModel.ConnectStringFactory(strConnectionString);

            container.Register <TmsWS.ServiceModel.IConnectString>(connectString);
            var secretKey = new TmsWS.ServiceModel.SecretKeyFactory(strSecretKey);

            container.Register <TmsWS.ServiceModel.ISecretKey>(secretKey);

            container.RegisterAutoWired <TmsWS.ServiceModel.Auth>();
            container.RegisterAutoWired <TmsWS.ServiceModel.Event.List_Login_Logic>();
            container.RegisterAutoWired <TmsWS.ServiceModel.Event.List_JobNo_Logic>();
            container.RegisterAutoWired <TmsWS.ServiceModel.Event.List_Container_Logic>();
            container.RegisterAutoWired <TmsWS.ServiceModel.Event.List_Jmjm6_Logic>();
            container.RegisterAutoWired <TmsWS.ServiceModel.Event.Update_Done_Logic>();
        }
Example #2
0
        public override void Configure(Container container)
        {
            //ServiceStack.Text.JsConfig.EmitCamelCaseNames = true; ! DO NOT USE THIS !
            //Feature disableFeatures = Feature.Xml | Feature.Jsv | Feature.Csv | Feature.Soap11 | Feature.Soap12 | Feature.Soap;
            SetConfig(new EndpointHostConfig
            {
                DebugMode = false,
                UseCustomMetadataTemplates = true,
                DefaultContentType = ContentType.Json,
                EnableFeatures = Feature.Json | Feature.Metadata
                //ServiceStackHandlerFactoryPath  = "api"
            });
            CorsFeature cf = new CorsFeature(allowedOrigins: "*", allowedMethods: "GET, POST, PUT, DELETE", allowedHeaders: "Content-Type, Signature", allowCredentials: false);
            this.Plugins.Add(cf);

            string strConnectionString = GetConnectionString();
            var dbConnectionFactory = new OrmLiteConnectionFactory(strConnectionString, SqlServerDialect.Provider)
            {
                ConnectionFilter =
                    x =>
                    new ProfiledDbConnection(x, Profiler.Current)
            };
            container.Register<IDbConnectionFactory>(dbConnectionFactory);

            var connectString = new TmsWS.ServiceModel.ConnectStringFactory(strConnectionString);
            container.Register<TmsWS.ServiceModel.IConnectString>(connectString);
            var secretKey = new TmsWS.ServiceModel.SecretKeyFactory(strSecretKey);
            container.Register<TmsWS.ServiceModel.ISecretKey>(secretKey);

            container.RegisterAutoWired<TmsWS.ServiceModel.Auth>();
            container.RegisterAutoWired<TmsWS.ServiceModel.Event.List_Login_Logic>();
            container.RegisterAutoWired<TmsWS.ServiceModel.Event.List_JobNo_Logic>();
            container.RegisterAutoWired<TmsWS.ServiceModel.Event.List_Container_Logic>();
            container.RegisterAutoWired<TmsWS.ServiceModel.Event.List_Jmjm6_Logic>();
            container.RegisterAutoWired<TmsWS.ServiceModel.Event.Update_Done_Logic>();
        }