diff options
Diffstat (limited to 'src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs')
| -rw-r--r-- | src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs b/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs index e6a4fcd..41af6a5 100644 --- a/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs +++ b/src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs @@ -2,32 +2,31 @@ using System; using IOL.VippsEcommerce.Models; using Microsoft.Extensions.DependencyInjection; -namespace IOL.VippsEcommerce -{ - public static class ServiceCollectionExtensions - { - /// <summary> - /// Configures and adds the VippsEcommerceService to your DI. - /// </summary> - /// <param name="services">Servicecollection to add VippsEcommerceService to.</param> - /// <param name="configuration"></param> - /// <returns></returns> - public static IServiceCollection AddVippsEcommerceService( - this IServiceCollection services, - Action<VippsConfiguration> configuration - ) { - if (services == null) { - throw new ArgumentNullException(nameof(services)); - } +namespace IOL.VippsEcommerce; - if (configuration == null) { - throw new ArgumentNullException(nameof(configuration)); - } +public static class ServiceCollectionExtensions +{ + /// <summary> + /// Configures and adds the VippsEcommerceService to your DI. + /// </summary> + /// <param name="services">Servicecollection to add VippsEcommerceService to.</param> + /// <param name="configuration"></param> + /// <returns></returns> + public static IServiceCollection AddVippsEcommerceService( + this IServiceCollection services, + Action<VippsConfiguration> configuration + ) { + if (services == null) { + throw new ArgumentNullException(nameof(services)); + } - services.Configure(configuration); - services.AddHttpClient<IVippsEcommerceService, VippsEcommerceService>(); - services.AddScoped<IVippsEcommerceService, VippsEcommerceService>(); - return services; + if (configuration == null) { + throw new ArgumentNullException(nameof(configuration)); } + + services.Configure(configuration); + services.AddHttpClient<IVippsEcommerceService, VippsEcommerceService>(); + services.AddScoped<IVippsEcommerceService, VippsEcommerceService>(); + return services; } } |
