ASP.NET Monsters #48: Configuring Entity Framework

Sign in to queue

Description

The patterns used for configuring Entity Framework Core are a little different when compared to previous versions of EF. In today's episode, Dave takes us through the OptionsBuilder pattern and a couple different methods of wiring it up to your DbContext classes.

Related Episodes:

Embed

Download

Download this episode

The Discussion

  • User profile image
    Alex219267

    Anyway I can place entity framework core in a class library file? Then reference it in other front end projects like Asp.net or others.

  • User profile image
    David​Paquette

    @Alex219267: Yeah for sure you can put your EF Core bits in a class library and reference that library in other projects. The only problem with that right now is that the EF migrations tool doesn't work with class libraries. I hope that issue is fixed soon.

  • User profile image
    Thiago Menezes

    There's a workaround to EF migrations tool work with class libraries.
    Just creating a static void Main method in a class.
    Look at this: http://benjii.me/2016/06/entity-framework-core-migrations-for-class-library-projects/

Add Your 2 Cents