@@ -26,7 +26,7 @@ public static ILinqToDBSettings LoadJson(string configPath)
2626 if ( cn . Key . EndsWith ( "_ProviderName" , StringComparison . InvariantCultureIgnoreCase ) )
2727 continue ;
2828
29- connections . Add ( cn . Key , new ConnectionStringSettings ( cn . Key , cn . Value ) ) ;
29+ connections . Add ( cn . Key , new ConnectionStringSettings ( cn . Key , PasswordManager . ResolvePasswordManagerFields ( cn . Value ) ) ) ;
3030 }
3131
3232 foreach ( var cn in config . ConnectionStrings )
@@ -64,7 +64,7 @@ public static ILinqToDBSettings LoadAppConfig(string configPath)
6464 var providerName = node . Attributes [ "providerName" ] ? . Value ;
6565
6666 if ( name != null && connectionString != null )
67- settings . Add ( new ConnectionStringSettings ( name , connectionString ) { ProviderName = providerName } ) ;
67+ settings . Add ( new ConnectionStringSettings ( name , PasswordManager . ResolvePasswordManagerFields ( connectionString ) ) { ProviderName = providerName } ) ;
6868 }
6969
7070 return new AppConfig ( settings . ToArray ( ) ) ;
@@ -82,11 +82,13 @@ private sealed class JsonConfig
8282 public IDictionary < string , string > ? ConnectionStrings { get ; set ; }
8383 }
8484
85+ /// <param name="name">Connection name.</param>
86+ /// <param name="connectionString">Must be connection string without password manager tokens.</param>
8587 private sealed class ConnectionStringSettings ( string name , string connectionString ) : IConnectionStringSettings
8688 {
8789 string IConnectionStringSettings . ConnectionString => connectionString ;
88- string IConnectionStringSettings . Name => name ;
89- bool IConnectionStringSettings . IsGlobal => false ;
90+ string IConnectionStringSettings . Name => name ;
91+ bool IConnectionStringSettings . IsGlobal => false ;
9092
9193 public string ? ProviderName { get ; set ; }
9294 }
0 commit comments