using Inotify.ThridOauth.Entity; using Inotify.ThridOauth.IService; using Inotify.ThridOauth.Service; using Microsoft.Extensions.DependencyInjection; using System; namespace Inotify.ThridOauth { public static class ThridPartyLoginExtensions { public static IServiceCollection AddWeChatLogin(this IServiceCollection services, Action credential) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.Configure(credential); services.AddScoped(); return services; } public static IServiceCollection AddQqLogin(this IServiceCollection services, Action credential) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.Configure(credential); services.AddScoped(); return services; } public static IServiceCollection AddSinaLogin(this IServiceCollection services, Action credential) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.Configure(credential); services.AddScoped(); return services; } public static IServiceCollection AddFackbookLogin(this IServiceCollection services, Action credential) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.Configure(credential); services.AddScoped(); return services; } public static IServiceCollection AddGitHubLogin(this IServiceCollection services, Action credential) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.Configure(credential); services.AddScoped(); return services; } } }