Move source code into "Source" folder
This commit is contained in:
parent
1ee73fa1a7
commit
389fbb2371
287 changed files with 26 additions and 8 deletions
22
Source/DataLayer/Configurations/ContributorConfig.cs
Normal file
22
Source/DataLayer/Configurations/ContributorConfig.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace DataLayer.Configurations
|
||||
{
|
||||
internal class ContributorConfig : IEntityTypeConfiguration<Contributor>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Contributor> entity)
|
||||
{
|
||||
entity.HasKey(c => c.ContributorId);
|
||||
entity.HasIndex(c => c.Name);
|
||||
|
||||
//entity.OwnsOne(b => b.AuthorProperty);
|
||||
// ... in separate table
|
||||
|
||||
entity
|
||||
.Metadata
|
||||
.FindNavigation(nameof(Contributor.BooksLink))
|
||||
.SetPropertyAccessMode(PropertyAccessMode.Field);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue