diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2021-04-18 23:26:06 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2021-04-18 23:26:06 +0200 |
| commit | 84ccd406ed7584bcedb71dca68113a58e9072f82 (patch) | |
| tree | ac4d3bcaf074d2c25beaa421b41859a815b66709 /src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs | |
| parent | 1426d12bc26bdfad06d8ac8118d43c3a066e303d (diff) | |
| download | dotnet-vipps-ecommerce-84ccd406ed7584bcedb71dca68113a58e9072f82.tar.xz dotnet-vipps-ecommerce-84ccd406ed7584bcedb71dca68113a58e9072f82.zip | |
Rename VippsConfigurationKeyNames.cs internally, formatting
Diffstat (limited to 'src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs')
| -rw-r--r-- | src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs b/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs index 1637dc9..57f1833 100644 --- a/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs +++ b/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs @@ -13,13 +13,17 @@ namespace IOL.VippsEcommerce /// <param name="configuration"></param> /// <returns></returns> public static IServiceCollection AddVippsEcommerceService( - this IServiceCollection services, - Action<VippsConfiguration> configuration + this IServiceCollection services, + Action<VippsConfiguration> configuration ) { - if (services == null) + if (services == null) { throw new ArgumentNullException(nameof(services)); - if (configuration == null) + } + + if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); + } + services.Configure(configuration); services.AddHttpClient<IVippsEcommerceService, VippsEcommerceService>(); services.AddScoped<IVippsEcommerceService, VippsEcommerceService>(); @@ -31,16 +35,15 @@ namespace IOL.VippsEcommerce /// </summary> /// <param name="services">Servicecollection to add VippsEcommerceService to.</param> /// <returns></returns> - public static IServiceCollection AddVippsEcommerceService( - this IServiceCollection services - ) { - if (services == null) + public static IServiceCollection AddVippsEcommerceService(this IServiceCollection services) { + if (services == null) { throw new ArgumentNullException(nameof(services)); - services.Configure(new Action<VippsConfiguration>(o => o.ConfigurationMode = - VippsConfigurationMode.ONLY_ENVIRONMENT)); + } + + services.Configure(new Action<VippsConfiguration>(o => o.ConfigurationMode = VippsConfigurationMode.ONLY_ENVIRONMENT)); services.AddHttpClient<IVippsEcommerceService, VippsEcommerceService>(); services.AddScoped<IVippsEcommerceService, VippsEcommerceService>(); return services; } } -}
\ No newline at end of file +} |
