-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document table-specific facet configuration
Document composite PK configuration using data annotations Document unidirectional many-to-many configuration and additional UsingEntity overloads Fixes #3849 Fixes #2944
- Loading branch information
1 parent
de1a618
commit 3da154f
Showing
6 changed files
with
165 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
samples/core/Modeling/Keys/DataAnnotations/KeyComposite.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace EFModeling.Keys.DataAnnotations.KeyComposite; | ||
|
||
internal class MyContext : DbContext | ||
{ | ||
public DbSet<Car> Cars { get; set; } | ||
} | ||
|
||
#region KeyComposite | ||
[PrimaryKey(nameof(State), nameof(LicensePlate))] | ||
internal class Car | ||
{ | ||
public string State { get; set; } | ||
public string LicensePlate { get; set; } | ||
|
||
public string Make { get; set; } | ||
public string Model { get; set; } | ||
} | ||
#endregion |