/// <summary> /// Initialize the provider /// </summary> /// <param name="name"> /// The name of the provider /// </param> /// <param name="config"> /// The configuration of the provider /// </param> public override void Initialize(string name, NameValueCollection config) { // Initialize values from web.config if (config == null) { throw new ArgumentNullException("config"); } name = ProviderUtils.ConfigValue(name, "DatabaseAbstractionRoleProvider"); if (String.IsNullOrEmpty(config["description"])) { config.Remove("description"); config.Add("description", "DatabaseAbstraction Role provider"); } // Initialize the abstract base class base.Initialize(name, config); ApplicationName = ProviderUtils.ConfigValue( config["applicationName"], HostingEnvironment.ApplicationVirtualPath); WriteExceptionsToEventLog = Convert.ToBoolean(ProviderUtils.ConfigValue( config["writeExceptionsToEventLog"], "false")); // Initialize connection string var settings = ConfigurationManager.ConnectionStrings[config["connectionStringName"]]; if ((null == settings) || (String.IsNullOrEmpty(settings.ConnectionString))) { throw new ProviderException("Connection string cannot be blank."); } ConnectionString = settings.ConnectionString; }