Skip to content

Configuring EntityFrameworkCore within 'AppDbContext.OnModelCreating'

Notifications You must be signed in to change notification settings

reiugit/EFCoreModelBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EFCoreModelBuilder Example

Configuring EntityFrameworkCore within 'AppDbContext.OnModelCreating'

  • Class AProduct is configured mostly with 'data annotations'
  • Class BProduct is configured only within the 'modelBuilder' in AppDbContext.OnModelCreating

Prerequisite:

  • This application needs a local SqlServer-Database.
  1. Use 'DOCKER compose up --detach' to create a local SqlServer instance.

  2. Use 'EFCore Migrations' to create a valid database:
    -- with 'ef migrations database update' in EFCore Tools
    -- or 'update-database' in the Package Manager Console

About

Configuring EntityFrameworkCore within 'AppDbContext.OnModelCreating'

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages