From 36afcdf0988e753ae2178fb8220b02f2c4d0b2b2 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 30 Jan 2022 01:41:08 +0100 Subject: refactor: Convert solution for file-scoped namespaces --- .../ServiceCollectionExtensions.cs | 47 +++++++++++----------- 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'src/IOL.VippsEcommerce/ServiceCollectionExtensions.cs') 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 - { - /// - /// Configures and adds the VippsEcommerceService to your DI. - /// - /// Servicecollection to add VippsEcommerceService to. - /// - /// - public static IServiceCollection AddVippsEcommerceService( - this IServiceCollection services, - Action configuration - ) { - if (services == null) { - throw new ArgumentNullException(nameof(services)); - } +namespace IOL.VippsEcommerce; - if (configuration == null) { - throw new ArgumentNullException(nameof(configuration)); - } +public static class ServiceCollectionExtensions +{ + /// + /// Configures and adds the VippsEcommerceService to your DI. + /// + /// Servicecollection to add VippsEcommerceService to. + /// + /// + public static IServiceCollection AddVippsEcommerceService( + this IServiceCollection services, + Action configuration + ) { + if (services == null) { + throw new ArgumentNullException(nameof(services)); + } - services.Configure(configuration); - services.AddHttpClient(); - services.AddScoped(); - return services; + if (configuration == null) { + throw new ArgumentNullException(nameof(configuration)); } + + services.Configure(configuration); + services.AddHttpClient(); + services.AddScoped(); + return services; } } -- cgit v1.3