private static CommerceRuntimeConfiguration GetDefaultCommerceRuntimeConfiguration()
            {
                var connectionString = ConfigurationManager.ConnectionStrings["HoustonStore"].ConnectionString;
                var section          = CommerceRuntimeConfigurationManager.GetConfigurationSection(CommerceRuntimeConfigurationManager.SectionName);

                return(new CommerceRuntimeConfiguration(section, connectionString, null, true, true));
            }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the commerce runtime configuration by using the currently executing application's config..
        /// </summary>
        /// <returns>The commerce runtime configuration.</returns>
        private static CommerceRuntimeConfiguration GetCrtConfiguration()
        {
            var crtConnectionString    = GetCrtConnectionString();
            var commerceRuntimeSection = CommerceRuntimeConfigurationManager.GetConfigurationSection("commerceRuntime");
            var crtConfiguration       = new CommerceRuntimeConfiguration(commerceRuntimeSection, crtConnectionString, true);

            return(crtConfiguration);
        }
Ejemplo n.º 3
0
            /// <summary>
            /// Gets the commerce runtime configuration by using the currently executing application's config..
            /// </summary>
            /// <returns>The commerce runtime configuration.</returns>
            internal static CommerceRuntimeConfiguration GetCrtConfiguration()
            {
                string initialConnectionString                            = CommerceRuntimeConfigurationManager.GetInitialConnectionString();
                CommerceRuntimeSection       section                      = CommerceRuntimeConfigurationManager.GetConfigurationSection(CommerceRuntimeConfigurationManager.SectionName);
                Dictionary <string, string>  connectionStrings            = CommerceRuntimeConfigurationManager.GetStorageLookupConnectionStrings();
                CommerceRuntimeConfiguration commerceRuntimeConfiguration = new CommerceRuntimeConfiguration(section, initialConnectionString, connectionStrings);

                return(commerceRuntimeConfiguration);
            }
Ejemplo n.º 4
0
            /// <summary>
            /// Gets the CommerceRuntime instance initialized by using the provided application configuration.
            /// </summary>
            /// <param name="appConfiguration">The application configuration.</param>
            /// <returns>Commerce runtime instance.</returns>
            /// <remarks>Caches the default channel identifier.</remarks>
            public static CommerceRuntime GetCommerceRuntime(Configuration appConfiguration)
            {
                string initialConnectionString                            = CommerceRuntimeConfigurationManager.GetInitialConnectionString(appConfiguration);
                CommerceRuntimeSection       section                      = CommerceRuntimeConfigurationManager.GetConfigurationSection(appConfiguration, CommerceRuntimeConfigurationManager.SectionName);
                Dictionary <string, string>  connectionStrings            = CommerceRuntimeConfigurationManager.GetStorageLookupConnectionStrings(appConfiguration);
                CommerceRuntimeConfiguration commerceRuntimeConfiguration = new CommerceRuntimeConfiguration(section, initialConnectionString, connectionStrings);
                CommerceRuntime runtime = GetCommerceRuntime(commerceRuntimeConfiguration);

                return(runtime);
            }
        private ProductManager GetProductManager()
        {
            var connectionString     = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
            var configurationSection = CommerceRuntimeConfigurationManager.GetConfigurationSection(CommerceRuntimeConfigurationManager.SectionName);
            var configuration        = new CommerceRuntimeConfiguration(configurationSection, connectionString);

            var principal = new CommercePrincipal(this.CommerceIdentity);

            var runtime = CommerceRuntime.Create(configuration, principal);
            var pm      = ProductManager.Create(runtime);

            return(pm);
        }