コード例 #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;
 }