Пример #1
0
 /// <summary>
 ///     Adds the NullMailer to dependency injection.
 /// </summary>
 /// <param name="services">The services.</param>
 /// <param name="mailerSettings">The settings.</param>
 /// <returns>IServiceCollection.</returns>
 /// <remarks>Will setup the mailer as the default</remarks>
 public static IServiceCollection AddNullMailer
 (
     this IServiceCollection services,
     NullMailerSettings mailerSettings
 )
 {
     return(services.AddMailer <NullMailer, NullMailerSettings>(mailerSettings));
 }
Пример #2
0
 /// <summary>
 /// Adds the safety mailer proxy for a NullMailer to dependency injection.
 /// </summary>
 /// <param name="services">The services.</param>
 /// <param name="safetyMailerSettings">The safety mailer settings.</param>
 /// <param name="mailerSettings">The mailer settings.</param>
 /// <returns>IServiceCollection.</returns>
 public static IServiceCollection AddSafetyMailer
 (
     this IServiceCollection services,
     SafetyMailerSettings safetyMailerSettings,
     NullMailerSettings mailerSettings
 )
 {
     return(AddMailer <SafetyMailer <NullMailer>, SafetyMailerSettings, NullMailer, NullMailerSettings>(
                services,
                mailerSettings,
                safetyMailerSettings));
 }
Пример #3
0
 /// <summary>
 ///     Registers a null mailer with the factory.
 /// </summary>
 /// <param name="factory">The factory.</param>
 /// <param name="mailerSettings">The mailer settings.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="store">The store.</param>
 public static void AddNullMailer
 (
     this MailerFactory factory,
     NullMailerSettings mailerSettings,
     ILogger <NullMailer> logger = null,
     IHistoryStore store         = null
 )
 {
     factory.Register <NullMailer, NullMailerSettings>(mailerSettings,
                                                       logger ?? factory.DefaultLoggerFactory?.CreateLogger <NullMailer>(),
                                                       factory.ConfigureHistoryStoreLogger(store));
 }