File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
extensions/src/AWSSDK.Extensions.NETCore.Setup Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,22 @@ public static IServiceCollection TryAddCredentialsFactory(this IServiceCollectio
8888 public static IServiceCollection AddCredentialsFactory (
8989 this IServiceCollection collection ,
9090 Func < IServiceProvider , IAWSCredentialsFactory > awsCredentialsFactoryFunc ,
91- ServiceLifetime lifetime = ServiceLifetime . Singleton ,
92- bool tryAdd = false )
91+ ServiceLifetime lifetime = ServiceLifetime . Singleton )
92+ {
93+ return collection . AddCredentialsFactoryInternal ( awsCredentialsFactoryFunc , lifetime , tryAdd : false ) ;
94+ }
95+
96+ /// <summary>
97+ /// Adds a IAWSCredentialsFactory object obtained via th provided awsCredentialsFactoryFunc to the dependency
98+ /// injection framework if no IAWSCredentialsFactory is already registered.
99+ /// This factory will be used to create the credentials for the Amazon service clients.
100+ /// </summary>
101+ public static IServiceCollection TryAddCredentialsFactory (
102+ this IServiceCollection collection ,
103+ Func < IServiceProvider , IAWSCredentialsFactory > awsCredentialsFactoryFunc ,
104+ ServiceLifetime lifetime = ServiceLifetime . Singleton )
93105 {
94- return collection . AddCredentialsFactoryInternal ( awsCredentialsFactoryFunc , lifetime , tryAdd ) ;
106+ return collection . AddCredentialsFactoryInternal ( awsCredentialsFactoryFunc , lifetime , tryAdd : true ) ;
95107 }
96108
97109 /// <summary>
You can’t perform that action at this time.
0 commit comments