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));
}
if (configuration == null) {
throw new ArgumentNullException(nameof(configuration));
}
services.Configure(configuration);
services.AddHttpClient();
services.AddScoped();
return services;
}
}
}