What is the replacement in Visual Studio 2017 for Entity Framework 'database first'

asp.net c# entity-framework-6 visual-studio-2017

Question

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
4
6/1/2017 3:23:37 AM

Accepted Answer

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
6/1/2017 10:41:16 AM

Popular Answer

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. :)



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow