예제 #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);
        }
예제 #2
0
 public EmailErrorNotifier(SmtpClient mailClient, IUserMembership membership, EmailErrorNotifierOptions options)
 {
     _mailClient = mailClient;
     _membership = membership;
     _options    = options;
 }