コード例 #1
0
 /// <summary>
 /// Add a health check for specified Azure Event Hub.
 /// </summary>
 /// <param name="builder">The <see cref="IHealthChecksBuilder"/>.</param>
 /// <param name="connectionString">The azure event hub connection string.</param>
 /// <param name="eventHubName">The azure event hub name.</param>
 /// <param name="name">The health check name. Optional. If <c>null</c> the type name 'azureeventhub' will be used for the name.</param>
 /// <param name="failureStatus">
 /// The <see cref="HealthStatus"/> that should be reported when the health check fails. Optional. If <c>null</c> then
 /// the default status of <see cref="HealthStatus.Unhealthy"/> will be reported.
 /// </param>
 /// <param name="tags">A list of tags that can be used to filter sets of health checks. Optional.</param>
 /// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param>
 /// <returns>The specified <paramref name="builder"/>.</returns>
 public static IHealthChecksBuilder AddAzureEventHub(
     this IHealthChecksBuilder builder,
     string connectionString,
     string eventHubName,
     string?name = default,
     HealthStatus?failureStatus = default,
     IEnumerable <string>?tags  = default,
     TimeSpan?timeout           = default) =>
 builder.AddAzureEventHub(
     _ => connectionString,
     _ => eventHubName,
     name,
     failureStatus,
     tags,
     timeout);