Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 2.1 KB

README.md

File metadata and controls

53 lines (40 loc) · 2.1 KB

EntityFrameworkCore.AutoLoad

Auto Load Configurations for EntityFrameworkCore

AutoLoad

This is an add-in for EntityFrameworkCore

Allow to use same configurations existing in EntityFramework 6 to auto load configurations.

Build status CodeFactor License: MIT NuGet NuGet

Nuget package

To Install from the Nuget Package Manager Console

PM > Install-Package EntityFrameworkCore.AutoLoad 
NET CLI - dotnet add package EntityFrameworkCore.AutoLoad
paket paket add EntityFrameworkCore.AutoLoad

Available here https://www.nuget.org/packages/EntityFrameworkCore.AutoLoad/#

Usage

Just call it from OnModelCreating in DbContext class it will read all your configuratons where they implement IEntityTypeConfiguration

 public class TestContext : DbContext
    {
        public TestContext(DbContextOptions<TestContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.AddFromAssembly(typeof(TestContext).Assembly);
            base.OnModelCreating(modelBuilder);
        }
    }

Sample here Usage

Icon

Created by Mariana Alemanno

Made with ❤ in DGENIX