Skip to content

Commit

Permalink
Add missing option validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Taillefer committed Aug 9, 2023
1 parent ac7f0da commit 12d439e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options.Validation;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.Extensions.Telemetry.Latency;
Expand Down Expand Up @@ -79,7 +80,7 @@ private static void CheckNames(string[] names)

private static void ConfigureOption(this IServiceCollection services, Action<LatencyContextRegistrationOptions> action)
{
_ = services.AddOptions<LatencyContextRegistrationOptions>();
_ = services.AddValidatedOptions<LatencyContextRegistrationOptions>();
_ = services.Configure(action);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\ToBeRemoved\Options.ValidateOnStart\Options.ValidateOnStart.csproj" />
<ProjectReference Include="..\Microsoft.Extensions.Compliance.Abstractions\Microsoft.Extensions.Compliance.Abstractions.csproj" />
</ItemGroup>

Expand Down Expand Up @@ -52,6 +53,6 @@
</ItemGroup>

<ItemGroup>
<InternalsVisibleToTest Include="$(AssemblyName).Tests"/>
<InternalsVisibleToTest Include="$(AssemblyName).Tests" />
</ItemGroup>
</Project>

0 comments on commit 12d439e

Please sign in to comment.