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

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            var options = new AvailableDiskSpaceCheckOptions();

            configuration.Bind(options);

            return(builder.AddAvailableDiskSpaceCheck(options));
        }
Esempio n. 2
0
        public static HealthCheckBuilder AddAvailableDiskSpaceCheck(this HealthCheckBuilder builder, AvailableDiskSpaceCheckOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var settings = new AvailableDiskSpaceCheckSettings(options.Name, options.Critical, options.Frequency, options.Tags, options.ErrorThreshold, options.WarningThreshold, options.Drive);

            return(builder.AddAvailableDiskSpaceCheck(settings));
        }