Example #1
0
        /// <summary>
        /// 用连接字符串构造信息管理类。
        /// </summary>
        /// <param name="connectionStringName">连接字符串。</param>
        public InfoManager(string connectionStringName)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(connectionStringName));

            this.db = new Database(connectionStringName);
        }
Example #2
0
        /// <summary>
        /// 初始化提供程序。
        /// </summary>
        /// <param name="name">该提供程序的友好名称。</param>
        /// <param name="config">名称/值对的集合,表示在配置中为该提供程序指定的、提供程序特定的属性。</param>
        public override void Initialize(string name, NameValueCollection config)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                name = "EFRoleProvider";
            }

            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "GHY EF角色提供程序。");
            }

            base.Initialize(name, config);
            this.ApplicationName = string.IsNullOrEmpty(config["applicationName"]) ? HostingEnvironment.ApplicationVirtualPath : config["applicationName"];

            this.db = new Database(config["connectionStringName"]);
        }