Raven.AspNetProviders.RavenSessionStateStoreProvider.Initialize C# (CSharp) Method

Initialize() public method

Initializes the provider.
The name of the provider is null. The name of the provider has a length of zero. An attempt is made to call /// /// on a provider after the provider has already been initialized. ///
public Initialize ( string name, NameValueCollection config ) : void
name string The friendly name of the provider.
config System.Collections.Specialized.NameValueCollection A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.
return void
        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
                throw new ArgumentNullException("config");

            base.Initialize(name, config);

            SetConfigurationProperties(config);

            if (_documentStore == null)
            {
                if (string.IsNullOrEmpty(config["connectionStringName"]))
                    throw new ConfigurationErrorsException("Must supply a connectionStringName.");

                _documentStore = new DocumentStore
                                     {
                                         ConnectionStringName = config["connectionStringName"],
                                     };

                _documentStore.Initialize();
            }
        }