4

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.

Ev Conrad
  • 323
  • 4
  • 17
  • I use db first all the time in Visual Studio 2017, you're using EF6 so you can too. – Kris Jun 01 '17 at 03:27
  • @Kris when I try to create a new item I don't have the option for any data-related items. Maybe looking in the wrong place? – Ev Conrad Jun 01 '17 at 03:41
  • Most likely you need to install the project templates. I doubt ef code first is not supported anymore. – CodingYoshi Jun 01 '17 at 03:49

2 Answers2

2

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.

ErikEJ
  • 40,951
  • 5
  • 75
  • 115
1

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