In ASP.NET Core MVC (.NET 6) can we use DataBase first approach

john john 1,021 Reputation points
2022-11-25T01:22:04.587+00:00

we are starting a new ASP.NET Core MVC (.NET 6) project. so is Database first approach a valid approach to follow?

Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-11-25T07:18:44.72+00:00

    Hi @john john ,

    Yes, we can use EF Core database first approach in Asp.net core MVC: use the dotnet ef dbcontext scaffold(CLI) or Scaffold-DbContext(visual studio) Command to generate the DbContext and Models based on the existing database.

    Personally, I prefer to use the code first approach, because I can do the database activity from the code.

    But if you have already a designed database and you don’t want to do extra effort then you can go with this approach. If your database is ready, then Entity Framework will complete his duty and create POCO entities for you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.

    Best regards,
    Dillion

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.