问题
Simple question - I'm working in Visual Studio 2017 and while I know that the 'database first' approach in EF is gone, I'm wondering what the replacement is. What I specifically would like to do is generate classes from an existing database. I see this: EntityFramework Reverse POCO Generator - is this the right option, or is there something in VS2017 I should be using? I would think that this would be obvious information, maybe I'm looking in the wrong place...
Note: I have an ASP.NET Core project, but am not using EF Core. I am using ASP.NET Core against the full .NET framework and EF6.
回答1:
You need to create a .NET Class Library for your EF6 code, and you can add Entity Data Model (with Database First) to this, or use EF Reverse POCO in this as well, but it must be a standard old-school csproj based project.
回答2:
Add a class library to your solution. Add new item to the class library and you will find the data template which holds the Entity Model. Choose and Configure (here you will find the 'database first' option) the entity model in the same old way. That's it. :)
来源:https://stackoverflow.com/questions/44297967/what-is-the-replacement-in-visual-studio-2017-for-entity-framework-database-fir