@@ -39,12 +39,12 @@ internal static IHostBuilder CreateDefaultBuilder(HostBuilderOptions options)
3939 }
4040
4141 builder
42- . UseStartupFilters ( )
42+ . UseOptionValidation ( )
4343 . ConfigureAppConfiguration ( ( context , config ) =>
4444 {
4545 // appsettings file or others
46- config . AddJsonFile ( Path . Combine ( fullPath , $ "{ ( defaultConfigName ) . Split ( "." ) [ 0 ] } .json") , optional : true )
47- . AddJsonFile ( Path . Combine ( fullPath , $ "{ ( defaultConfigName ) . Split ( "." ) [ 0 ] } .{ options . HostingEnviroment } .json") , optional : true ) ;
46+ config . AddJsonFile ( Path . Combine ( fullPath , $ "{ defaultConfigName . Split ( "." ) [ 0 ] } .json") , optional : true )
47+ . AddJsonFile ( Path . Combine ( fullPath , $ "{ defaultConfigName . Split ( "." ) [ 0 ] } .{ options . HostingEnviroment } .json") , optional : true ) ;
4848
4949 // add secrets if specified
5050 if ( options . UserSecrets )
@@ -53,14 +53,14 @@ internal static IHostBuilder CreateDefaultBuilder(HostBuilderOptions options)
5353 }
5454
5555 // configure Azure Vault from the other settings.
56- var appAzureVaultUrl = config . Build ( ) . Bind < AzureVaultOptions > ( "AzureVault" , enableValidation : false ) ;
56+ var appAzureVaultUrl = config . Build ( ) . Bind < AzureVaultOptions > ( "AzureVault" , enableValidation : false ) ;
5757
5858 // build azure key vault from passed in parameter
5959 if ( ! string . IsNullOrWhiteSpace ( options . AzureVault ) )
6060 {
6161 var dic = new Dictionary < string , string >
6262 {
63- { "AzureVault:BaseUrl" , options . AzureVault }
63+ { "AzureVault:BaseUrl" , options . AzureVault }
6464 } ;
6565
6666 config . AddInMemoryCollection ( dic ) ;
@@ -70,26 +70,26 @@ internal static IHostBuilder CreateDefaultBuilder(HostBuilderOptions options)
7070 if ( ! string . IsNullOrWhiteSpace ( appAzureVaultUrl . BaseUrl )
7171 || ! string . IsNullOrWhiteSpace ( options . AzureVault ) )
7272 {
73- config . AddAzureKeyVault ( hostingEnviromentName : options . HostingEnviroment , options . UseAzureKeyPrefix ) ;
73+ config . AddAzureKeyVault ( hostingEnviromentName : options . HostingEnviroment , options . UseAzureKeyPrefix ) ;
7474 }
7575
76- if ( ! string . IsNullOrWhiteSpace ( options . Settings . ClientId )
76+ if ( ! string . IsNullOrWhiteSpace ( options . Settings . ClientId )
7777 && ! string . IsNullOrWhiteSpace ( options . Settings . ClientSecret ) )
7878 {
7979 var inputValues = new Dictionary < string , string >
8080 {
81- { $ "{ options . SectionName } :ClientId", options . Settings . ClientId } ,
82- { $ "{ options . SectionName } :ClientSecret", options . Settings . ClientSecret } ,
83- { $ "{ options . SectionName } :LoginUrl", options . Settings . LoginUrl } ,
84- { $ "{ options . SectionName } :OAuthUri", options . Settings . OAuthUri } ,
85- { $ "{ options . SectionName } :OAuthorizeUri", options . Settings . OAuthorizeUri } ,
81+ { $ "{ options . SectionName } :ClientId", options . Settings . ClientId } ,
82+ { $ "{ options . SectionName } :ClientSecret", options . Settings . ClientSecret } ,
83+ { $ "{ options . SectionName } :LoginUrl", options . Settings . LoginUrl } ,
84+ { $ "{ options . SectionName } :OAuthUri", options . Settings . OAuthUri } ,
85+ { $ "{ options . SectionName } :OAuthorizeUri", options . Settings . OAuthorizeUri } ,
8686 } ;
8787
8888 config . AddInMemoryCollection ( inputValues ) ;
8989 }
9090
91- if ( options . Verbose && options . Level == LogLevel . Debug
92- || options . Level == LogLevel . Trace )
91+ if ( ( options . Verbose && options . Level == LogLevel . Debug )
92+ || options . Level == LogLevel . Trace )
9393 {
9494 config . Build ( ) . DebugConfigurations ( ) ;
9595 }
0 commit comments