Exemple #1
0
        public static IServiceCollection AddEmailErrorNotifier(this IServiceCollection services, Action <EmailErrorNotifierOptions> options)
        {
            services.AddScoped <IErrorNotifier, EmailErrorNotifier>();
            services.AddScoped <EmailErrorNotifierOptions>((s) => {
                var opts = new EmailErrorNotifierOptions();
                options(opts);
                return(opts);
            });

            return(services);
        }
 public EmailErrorNotifier(SmtpClient mailClient, ICustomMembership membership, EmailErrorNotifierOptions options)
 {
     _mailClient = mailClient;
     _membership = membership;
     _options    = options;
 }