public static void AddReCaptcha(this IServiceCollection services, ReCaptchaOptions reCaptchaOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (reCaptchaOptions == null) { throw new ArgumentNullException(nameof(reCaptchaOptions)); } services.AddSingleton(reCaptchaOptions); services.AddSingleton <ReCaptchaService>(); }
public ReCaptchaService(ReCaptchaOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); }