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

Initialize() public method

public Initialize ( string name, NameValueCollection config ) : void
name string
config System.Collections.Specialized.NameValueCollection
return void
        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
                throw new ArgumentNullException("config");

            _providerName = name;

            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();
            }

            // create indexes
            _documentStore.ExecuteIndex(new Users_ByApplicationNameAndRoleName());
        }