Model First approach in entityframework core RRS feed

  • Question

  • User1503290756 posted


    Can any one please guide me that is there Model First approach in entityframwork core. 

    Please try to help with some reference of authentic materials.


    Thursday, June 27, 2019 6:03 AM

All replies

  • User753101303 posted


    It is not available in EF Core. See https://docs.microsoft.com/en-us/ef/efcore-and-ef6/#feature-comparison.The next EF 6.x version will be compatible with ASP.NET Core.

    Double check if this is a still your best option and consider maybe to mdoel you db with some other tool if you want and then use "code first from database" (or scaffolding in EF Core)

    Edit; this is https://devblogs.microsoft.com/dotnet/announcing-entity-framework-6-3-preview-with-net-core-support/ but using EDMX is not (yet ?) supported for ASP.NET Core projects.

    Thursday, June 27, 2019 6:33 AM
  • User-2054057000 posted

    In short Model First Approach is when you create the classes in your Application and these classes represents the tables of the database. 

    Example If your application has 2 classes called Employees & Departments. Then your database will have at least these 2 tables called Employees & Departments.

    Now The most important thing:

    In Model First Approach you do not create the database manually, instead you tell your application to create the database for you based on the classes (Employees & Departments) which you have in your application. This is done through Migration commands. 

    I hope you will find my short answer quite useful. 

    Also refer these 2 tutorials:

    1. Code - First Approach in Entity Framework Core
    2. EF Core Migrations
    Thursday, June 27, 2019 10:31 AM