Exemplo n.º 1
0
        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>();
        }
Exemplo n.º 2
0
 public ReCaptchaService(ReCaptchaOptions options)
 {
     _options = options ?? throw new ArgumentNullException(nameof(options));
 }