Exemplo n.º 1
0
        public static HealthCheckBuilder AddSmtpCheck(this HealthCheckBuilder builder, IConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            var options = new SmtpCheckOptions();

            configuration.Bind(options);

            return(builder.AddSmtpCheck(options));
        }
Exemplo n.º 2
0
        public static HealthCheckBuilder AddSmtpCheck(this HealthCheckBuilder builder, SmtpCheckOptions watchOptions)
        {
            var settings = new SmtpCheckSettings(watchOptions.Name, watchOptions.Critical, watchOptions.Frequency, watchOptions.Tags, watchOptions.SmtpAddress, watchOptions.SmtpPort, watchOptions.UseSsl);

            return(builder.Add <SmtpCheck>(settings));
        }