Which approach of entity framework should I use in ASP.NET MVC

Pinky 21 Reputation points
2021-06-15T04:54:06.453+00:00

Hello all,
I am new to asp.net mvc,want to create an application where can user Asp.net mvc,Sql,Ef.

Which approach is normally used in Industry dbfirst or codefirst.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,396 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,071 Reputation points
    2021-06-15T08:05:41.573+00:00

    Hi @Pinky ,
    As far as I think,for the die-hard developers, obviously, the Code-First would be the ideal way. Developers could full control over the code.
    For the Database designers,they could use database first.They will let EF create entities for you and after modification of mapping you will generate POCO entities.
    Best regards,
    Yijing Sun


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Duane Arnold 3,216 Reputation points
    2021-06-17T01:13:58.883+00:00

    Well, if you don't have basic DBA skills, then most software developers will use code first. And besides, that is what is being taught in the tutorials.

    If one is using DB first, then it means that the software developer is building the database manually using a tool like SSMS, and the software developer has basic DBA skills. This allows for the EF model to be built from an existing database the software developer created.

    By the software developer having basic DBA skills no matter if using Code or DB first, it gives the developer insight when things go wrong with using EF.

    0 comments No comments