Skip to content

Commit

Permalink
Update highlight in modeling/index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd committed Mar 4, 2020
1 parent 627af86 commit c277b57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entity-framework/core/modeling/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ This article covers configuration that can be applied to a model targeting any d

You can override the `OnModelCreating` method in your derived context and use the `ModelBuilder API` to configure your model. This is the most powerful method of configuration and allows configuration to be specified without modifying your entity classes. Fluent API configuration has the highest precedence and will override conventions and data annotations.

[!code-csharp[Main](../../../samples/core/Modeling/FluentAPI/Required.cs?highlight=11-13)]
[!code-csharp[Main](../../../samples/core/Modeling/FluentAPI/Required.cs?highlight=12-14)]

## Use data annotations to configure a model

You can also apply attributes (known as Data Annotations) to your classes and properties. Data annotations will override conventions, but will be overridden by Fluent API configuration.

[!code-csharp[Main](../../../samples/core/Modeling/DataAnnotations/Required.cs?highlight=14)]
[!code-csharp[Main](../../../samples/core/Modeling/DataAnnotations/Required.cs?highlight=15)]

0 comments on commit c277b57

Please sign in to comment.