Esempio n. 1
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);
            }
Esempio n. 2
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);
            }