I have recently changed from Windows to MacOS and I'd like to make a simple project with ASP.NET Core Entity Framework with CRUD operations. I want to use Database First.
So please can someone guide me in the right path, how I can setup an ASP.NET Core Entity Framework with Database First. I been stuck for a few weeks now.
I use Visual Studio and Workbench.
You should be able to do so via the dotnet cli, and reverse engineer your database design into EF Core entities. So eg. open terminal and type in the
breaking the cli command up it would be
dotnet efis the ef core part of the clidbcontext scaffoldis the name of the command"Server={sql_server_name};Database={database_name};Trusted Connection=True;"would be your connection stringso depending on what sql server you are, I would assume it's a mysql with workbench which means you would probably type in a username and password, so instead of Trusted Connection=True; you would provide a uid={username} and pwd={password}
Microsoft.EntityFramework.SqlServerthis tells the cli which databaseprovider to use.-o Modelsis the name of the output folder you want the generated models to be generated in.with all these things in mind I would suggest you'd try this in the root folder of your project.
Link to the documentation:
https://www.entityframeworktutorial.net/efcore/create-model-for-existing-database-in-ef-core.aspx