Exemplo n.º 1
0
 /// <summary>
 /// 绑定配置根包含的默认租户配置节(支持加密连接字符串)。
 /// </summary>
 /// <examples>
 /// JSON 配置节点结构参考:
 /// <code>
 /// {
 ///     "DefaultTenant": {
 ///         "Name": "name",
 ///         "Host": "host",
 ///         "DefaultConnectionString": "default connection string",
 ///         "WritingConnectionString": "writing connection string",
 ///         "WritingSeparation": true // or false
 ///     }
 /// }
 /// </code>
 /// </examples>
 /// <exception cref="ArgumentNullException">
 /// this.ConfigurationRoot is null.
 /// </exception>
 /// <param name="validateFactory">给定用于验证连接字符串的工厂方法(可选)。</param>
 /// <returns>返回 <see cref="DataBuilderDependency"/>。</returns>
 public virtual DataBuilderDependency BindDefaultTenant(Func <string, string> validateFactory = null)
 {
     ConfigurationRoot.NotNull(nameof(ConfigurationRoot));
     return(BindDefaultTenant(ConfigurationRoot.GetSection(DefaultTenantSectionName), validateFactory));
 }