/// <summary>
 ///     ctor
 /// </summary>
 /// <param name="sendGridEmailSettings"></param>
 public SendGridEmailSender(IOptions <SendGridEmailSettings> sendGridEmailSettings)
 {
     _sendGridEmailSettings = sendGridEmailSettings.Value ?? throw new ArgumentNullException(nameof(sendGridEmailSettings)); .
コード例 #2
0
 public SendGridService(IOptions <SendGridEmailSettings> emailOptions)
 {
     _emailSettings = emailOptions.Value;
 }
コード例 #3
0
 public EmailsApiController(IEmailSender emailService, IOptions <SendGridEmailSettings> emailOptions)
 {
     _emailService  = emailService;
     _emailSettings = emailOptions.Value;
 }
コード例 #4
0
ファイル: EccSendGridRegistrar.cs プロジェクト: dimaserd/Zoo
 public static IServiceCollection RegisterSendGridEmailSender(this IServiceCollection services, SendGridEmailSettings model)
 {
     return(services
            .AddSingleton(model)
            .AddScoped <IEmailSender, SendGridEmailSender>());
 }
コード例 #5
0
 /// <summary>
 ///     ctor
 /// </summary>
 /// <param name="sendGridEmailSettings"></param>
 public SendGridEmailService(IOptions <SendGridEmailSettings> sendGridEmailSettings)
 {
     _sendGridEmailSettings = sendGridEmailSettings.Value ?? throw new ArgumentNullException(nameof(sendGridEmailSettings));
     _sendGridClient        = new SendGridClient(_sendGridEmailSettings.SendGridApiKey);
 }
コード例 #6
0
ファイル: SendGridEmailSender.cs プロジェクト: dimaserd/Zoo
 public SendGridEmailSender(SendGridEmailSettings settings)
 {
     Settings = settings;
     Client   = new SendGridClient(Settings.ApiKey);
 }