diff --git a/Source/DataLayer/Configurations/CategoryConfig.cs b/Source/DataLayer/Configurations/CategoryConfig.cs index 3b1fcde7..fc7c72fb 100644 --- a/Source/DataLayer/Configurations/CategoryConfig.cs +++ b/Source/DataLayer/Configurations/CategoryConfig.cs @@ -9,6 +9,9 @@ namespace DataLayer.Configurations { entity.HasKey(c => c.CategoryId); entity.HasIndex(c => c.AudibleCategoryId); + + // seeds go here. examples in Dinah.EntityFrameworkCore.Tests\DbContextFactoryExample.cs + entity.HasData(Category.GetEmpty()); } } } \ No newline at end of file diff --git a/Source/DataLayer/Configurations/ContributorConfig.cs b/Source/DataLayer/Configurations/ContributorConfig.cs index 581b4e01..4b810b86 100644 --- a/Source/DataLayer/Configurations/ContributorConfig.cs +++ b/Source/DataLayer/Configurations/ContributorConfig.cs @@ -17,6 +17,9 @@ namespace DataLayer.Configurations .Metadata .FindNavigation(nameof(Contributor.BooksLink)) .SetPropertyAccessMode(PropertyAccessMode.Field); + + // seeds go here. examples in Dinah.EntityFrameworkCore.Tests\DbContextFactoryExample.cs + entity.HasData(Contributor.GetEmpty()); } } } \ No newline at end of file diff --git a/Source/DataLayer/LibationContext.cs b/Source/DataLayer/LibationContext.cs index 4787e652..8ae3a545 100644 --- a/Source/DataLayer/LibationContext.cs +++ b/Source/DataLayer/LibationContext.cs @@ -47,15 +47,6 @@ namespace DataLayer modelBuilder.ApplyConfiguration(new SeriesBookConfig()); modelBuilder.ApplyConfiguration(new CategoryConfig()); - // seeds go here. examples in Dinah.EntityFrameworkCore.Tests\DbContextFactoryExample.cs - - modelBuilder - .Entity() - .HasData(Category.GetEmpty()); - modelBuilder - .Entity() - .HasData(Contributor.GetEmpty()); - // views are now supported via "keyless entity types" (instead of "entity types" or the prev "query types"): // https://docs.microsoft.com/en-us/ef/core/modeling/keyless-entity-types }