Skip to content

Commit

Permalink
Improve README consistency (#4690)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros authored Nov 9, 2023
1 parent 135e950 commit 35e5d04
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ These APIs are only available for ASP.NET Core 8+.
The services can be registered using the following methods:

```csharp
public static IServiceCollection AddHttpLoggingRedaction(this IServiceCollection services, Action<HeaderParsingOptions>? configure = null);
public static IServiceCollection AddHttpLoggingRedaction(this IServiceCollection services, IConfigurationSection section);
public static IServiceCollection AddHttpLoggingRedaction(this IServiceCollection services, Action<HeaderParsingOptions>? configure = null)
public static IServiceCollection AddHttpLoggingRedaction(this IServiceCollection services, IConfigurationSection section)
public static IServiceCollection AddHttpLogEnricher<T>(this IServiceCollection services)
```

The middleware can be registered using the following method:

```csharp
public static IApplicationBuilder UseHttpLogging(this IApplicationBuilder builder);
public static IApplicationBuilder UseHttpLogging(this IApplicationBuilder builder)
```

For example:
Expand Down
6 changes: 3 additions & 3 deletions src/Libraries/Microsoft.AspNetCore.HeaderParsing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Or directly in the C# project file:
The services can be registered using one of the `AddHeaderParsing` overloads:

```csharp
public static IServiceCollection AddHeaderParsing(this IServiceCollection services);
public static IServiceCollection AddHeaderParsing(this IServiceCollection services, Action<HeaderParsingOptions> configure);
public static IServiceCollection AddHeaderParsing(this IServiceCollection services, IConfigurationSection section);
public static IServiceCollection AddHeaderParsing(this IServiceCollection services)
public static IServiceCollection AddHeaderParsing(this IServiceCollection services, Action<HeaderParsingOptions> configure)
public static IServiceCollection AddHeaderParsing(this IServiceCollection services, IConfigurationSection section)
```

For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Or directly in the C# project file:
The services can be registered using one of the `AddRedaction` overloads:

```csharp
public static IServiceCollection AddRedaction(this IServiceCollection services);
public static IServiceCollection AddRedaction(this IServiceCollection services, Action<IRedactionBuilder> configure);
public static IServiceCollection AddRedaction(this IServiceCollection services)
public static IServiceCollection AddRedaction(this IServiceCollection services, Action<IRedactionBuilder> configure)
```

### Configuring a redactor
Expand Down Expand Up @@ -54,9 +54,8 @@ builder.Services.AddRedaction(redactionBuilder => { });
The HMAC redactor can be configured using one these `IRedactionBuilder` extension methods:

```csharp
public static IRedactionBuilder SetHmacRedactor(this IRedactionBuilder builder, Action<HmacRedactorOptions> configure, params DataClassificationSet[] classifications);

public static IRedactionBuilder SetHmacRedactor(this IRedactionBuilder builder, IConfigurationSection section, params DataClassificationSet[] classifications);
public static IRedactionBuilder SetHmacRedactor(this IRedactionBuilder builder, Action<HmacRedactorOptions> configure, params DataClassificationSet[] classifications)
public static IRedactionBuilder SetHmacRedactor(this IRedactionBuilder builder, IConfigurationSection section, params DataClassificationSet[] classifications)
```

The `HmacRedactorOptions` requires its `KeyId` and `Key` properties to be set. The `HmacRedactor` is still in the experimental phase, which means that the above two methods will show warning `EXTEXP0002` notifying you that the `HmacRedactor` is not yet stable. In order to use it, you will need to either add `<NoWarn>$(NoWarn);EXTEXP0002</NoWarn>` to your project file or add `#pragma warning disable EXTEXP0002` around the calls to `SetHmacRedactor`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The `FakeRedactor` class provides options and services to verify redaction event
The fake redactor services can be registered using one of the `AddFakeRedaction` overloads:

```csharp
public static IServiceCollection AddFakeRedaction(this IServiceCollection services);
public static IServiceCollection AddFakeRedaction(this IServiceCollection services, Action<FakeRedactorOptions> configure);
public static IServiceCollection AddFakeRedaction(this IServiceCollection services)
public static IServiceCollection AddFakeRedaction(this IServiceCollection services, Action<FakeRedactorOptions> configure)
```

For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ Or directly in the C# project file:
The services to auto-activate can be registered using the following methods:

```csharp
static IServiceCollection ActivateSingleton<TService>(this IServiceCollection services);
static IServiceCollection ActivateSingleton(this IServiceCollection services, Type serviceType);
static IServiceCollection AddActivatedSingleton<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory);
static IServiceCollection AddActivatedSingleton<TService, TImplementation>(this IServiceCollection services);
static IServiceCollection AddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory);
static IServiceCollection AddActivatedSingleton<TService>(this IServiceCollection services);
static IServiceCollection AddActivatedSingleton(this IServiceCollection services, Type serviceType);
static IServiceCollection AddActivatedSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory);
static IServiceCollection AddActivatedSingleton(this IServiceCollection services, Type serviceType, Type implementationType);
static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType);
static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType, Type implementationType);
static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory);
static void TryAddActivatedSingleton<TService>(this IServiceCollection services);
static void TryAddActivatedSingleton<TService, TImplementation>(this IServiceCollection services);
static void TryAddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory);

static IServiceCollection ActivateKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey);
static IServiceCollection ActivateKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey);
static IServiceCollection AddActivatedKeyedSingleton<TService, TImplementation>(this IServiceCollection services, object? serviceKey, Func<IServiceProvider, object?, TImplementation> implementationFactory);
static IServiceCollection AddActivatedKeyedSingleton<TService, TImplementation>(this IServiceCollection services, object? serviceKey);
static IServiceCollection AddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory);
static IServiceCollection AddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey);
static IServiceCollection AddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey);
static IServiceCollection AddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory);
static IServiceCollection AddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Type implementationType);
static void TryAddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey);
static void TryAddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Type implementationType);
static void TryAddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory);
static void TryAddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey);
static void TryAddActivatedKeyedSingleton<TService, TImplementation>(this IServiceCollection services, object? serviceKey);
TryAddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory)
public static IServiceCollection ActivateSingleton<TService>(this IServiceCollection services)
public static IServiceCollection ActivateSingleton(this IServiceCollection services, Type serviceType)
public static IServiceCollection AddActivatedSingleton<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory)
public static IServiceCollection AddActivatedSingleton<TService, TImplementation>(this IServiceCollection services)
public static IServiceCollection AddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
public static IServiceCollection AddActivatedSingleton<TService>(this IServiceCollection services)
public static IServiceCollection AddActivatedSingleton(this IServiceCollection services, Type serviceType)
public static IServiceCollection AddActivatedSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
public static IServiceCollection AddActivatedSingleton(this IServiceCollection services, Type serviceType, Type implementationType)
public static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType)
public static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType, Type implementationType)
public static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
public static void TryAddActivatedSingleton<TService>(this IServiceCollection services)
public static void TryAddActivatedSingleton<TService, TImplementation>(this IServiceCollection services)
public static void TryAddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
public static IServiceCollection ActivateKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey)
public static IServiceCollection ActivateKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey)
public static IServiceCollection AddActivatedKeyedSingleton<TService, TImplementation>(this IServiceCollection services, object? serviceKey, Func<IServiceProvider, object?, TImplementation> implementationFactory)
public static IServiceCollection AddActivatedKeyedSingleton<TService, TImplementation>(this IServiceCollection services, object? serviceKey)
public static IServiceCollection AddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory)
public static IServiceCollection AddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey)
public static IServiceCollection AddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey)
public static IServiceCollection AddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory)
public static IServiceCollection AddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Type implementationType)
public static void TryAddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey)
public static void TryAddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Type implementationType)
public static void TryAddActivatedKeyedSingleton(this IServiceCollection services, Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory)
public static void TryAddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey)
public static void TryAddActivatedKeyedSingleton<TService, TImplementation>(this IServiceCollection services, object? serviceKey)
public static void TryAddActivatedKeyedSingleton<TService>(this IServiceCollection services, object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory)
```

For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Or directly in the C# project file:
The services can be registered using the following methods:

```csharp
public static IServiceCollection AddExceptionSummarizer(this IServiceCollection services);
public static IServiceCollection AddExceptionSummarizer(this IServiceCollection services, Action<IExceptionSummarizationBuilder> configure);
public static IServiceCollection AddExceptionSummarizer(this IServiceCollection services)
public static IServiceCollection AddExceptionSummarizer(this IServiceCollection services, Action<IExceptionSummarizationBuilder> configure)
```

For example:
Expand Down
20 changes: 10 additions & 10 deletions src/Libraries/Microsoft.Extensions.Http.Diagnostics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ In order to use the redaction feature, you need to reference the `Microsoft.Exte
The services can be registered using the following methods:

```csharp
public static IServiceCollection AddExtendedHttpClientLogging(this IServiceCollection services);
public static IServiceCollection AddExtendedHttpClientLogging(this IServiceCollection services, IConfigurationSection section);
public static IServiceCollection AddExtendedHttpClientLogging(this IServiceCollection services, Action<LoggingOptions> configure);
public static IServiceCollection AddHttpClientLogEnricher<T>(this IServiceCollection services) where T : class, IHttpClientLogEnricher;
public static IServiceCollection AddExtendedHttpClientLogging(this IServiceCollection services)
public static IServiceCollection AddExtendedHttpClientLogging(this IServiceCollection services, IConfigurationSection section)
public static IServiceCollection AddExtendedHttpClientLogging(this IServiceCollection services, Action<LoggingOptions> configure)
public static IServiceCollection AddHttpClientLogEnricher<T>(this IServiceCollection services) where T : class, IHttpClientLogEnricher
```

For example:
Expand All @@ -58,9 +58,9 @@ var host = builder.Build();
You can also use the following extension methods to apply the logging to the specific `IHttpClientBuilder`:

```csharp
public static IHttpClientBuilder AddExtendedHttpClientLogging(this IHttpClientBuilder builder);
public static IHttpClientBuilder AddExtendedHttpClientLogging(this IHttpClientBuilder builder, IConfigurationSection section);
public static IHttpClientBuilder AddExtendedHttpClientLogging(this IHttpClientBuilder builder, Action<LoggingOptions> configure);
public static IHttpClientBuilder AddExtendedHttpClientLogging(this IHttpClientBuilder builder)
public static IHttpClientBuilder AddExtendedHttpClientLogging(this IHttpClientBuilder builder, IConfigurationSection section)
public static IHttpClientBuilder AddExtendedHttpClientLogging(this IHttpClientBuilder builder, Action<LoggingOptions> configure)
```

For example:
Expand All @@ -87,9 +87,9 @@ These components enable tracking and reporting the latency of HTTP Client reques
The services can be registered using the following methods:

```csharp
public static IServiceCollection AddHttpClientLatencyTelemetry(this IServiceCollection services);
public static IServiceCollection AddHttpClientLatencyTelemetry(this IServiceCollection services, IConfigurationSection section);
public static IServiceCollection AddHttpClientLatencyTelemetry(this IServiceCollection services, Action<HttpClientLatencyTelemetryOptions> configure);
public static IServiceCollection AddHttpClientLatencyTelemetry(this IServiceCollection services)
public static IServiceCollection AddHttpClientLatencyTelemetry(this IServiceCollection services, IConfigurationSection section)
public static IServiceCollection AddHttpClientLatencyTelemetry(this IServiceCollection services, Action<HttpClientLatencyTelemetryOptions> configure)
```

For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ Or directly in the C# project file:
The object pools can be registered using the following methods:

```csharp
public static IServiceCollection AddPooled<TService>(this IServiceCollection services, Action<DependencyInjectionPoolOptions>? configure = null)

public static IServiceCollection AddPooled<TService, TImplementation>(this IServiceCollection services, Action<DependencyInjectionPoolOptions>? configure = null)
public static IServiceCollection AddPooled<TService>(this IServiceCollection services, Action<DependencyInjectionPoolOptions>? configure = null)
public static IServiceCollection AddPooled<TService, TImplementation>(this IServiceCollection services, Action<DependencyInjectionPoolOptions>? configure = null)
```

For example:
Expand Down

0 comments on commit 35e5d04

Please sign in to comment.