Skip to content

Commit

Permalink
Add attribute namespace (#14975)
Browse files Browse the repository at this point in the history
RequiredAttribute etc comes from the System.ComponentModel.DataAnnotations namespace.
Previously implied coming from Microsoft.Extensions.DependencyInjection
  • Loading branch information
centreboard authored and Rick-Anderson committed Oct 10, 2019
1 parent 5adf11b commit af3fbf4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions aspnetcore/fundamentals/configuration/options.md
Expand Up @@ -339,6 +339,7 @@ public interface IValidateOptions<TOptions> where TOptions : class
Data Annotation-based validation is available from the [Microsoft.Extensions.Options.DataAnnotations](https://www.nuget.org/packages/Microsoft.Extensions.Options.DataAnnotations) package by calling the <xref:Microsoft.Extensions.DependencyInjection.OptionsBuilderDataAnnotationsExtensions.ValidateDataAnnotations*> method on `OptionsBuilder<TOptions>`. `Microsoft.Extensions.Options.DataAnnotations` is included in the [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app) (ASP.NET Core 2.2 or later).

```csharp
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.DependencyInjection;

private class AnnotatedOptions
Expand Down

0 comments on commit af3fbf4

Please sign in to comment.