17

The Issue...

As the title states, I've installed the .NET Core 2.1 SDK and created a new .NET Core 2.1 project. When I go to Project > Add Item... > Data, I do not have the ADO.NET Entity Data Model option.

I am using Visual Studio 2017 15.7.3, which I've installed only hours ago.

The Error and Warning logs are clean.

Any assistance is appreciated.


What I've done so far...

Tyler Roper
  • 21,445
  • 6
  • 33
  • 56

1 Answers1

16

EntityFramework Core doesn't use the "EDMX" data model designers, it is purely code-first.

See the Getting Started with EF Core on ASP.NET Core with an Existing Database to scaffold a database context from an existing database or create a new model and use migrations to create and update databases.

Update: In .NET Core 3.0, you will be able to use Entity Framework 6 along with .edmx models (which may require VS 2019)

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
  • 1
    Ahh I had read that page, however wanted to stick with what I knew and so I glazed over the scaffolding portion, although I *did* grab `Microsoft.VisualStudio.Web.CodeGeneration.Design (2.1.0)`. Knowing that I don't have much of an option, I suppose I'll end up going that route. Thanks! – Tyler Roper Jun 11 '18 at 14:07
  • Hmmm... So I've done some reading, and while I was able to confirm that EntityFramework Core does not use `EDMX` files just as you've stated, from what I've read it sounds like the Add Items dialog *should* still give me the *Entity Data Model* option, however it would simply add the class files instead of the EDMX. In any event, I'm fine using the scaffolding solution. Thanks for your time. – Tyler Roper Jun 11 '18 at 15:09
  • Even if you do that, there’s some tooling missing to build and embed the model in the correct way and designer support is fragile at best on the new project system. For the core 3.0 Timeline, plans for a new version of classic EF (6.3) for .net core were announced – Martin Ullrich Jun 11 '18 at 16:29
  • 1
    Personally I suggest moving to code-first since it makes developing and migrations easier – Martin Ullrich Jun 11 '18 at 16:30
  • I appreciate the insight. I'm implementing this in a personal pet-project with the goal to learn a few new frameworks and such, so going the alternative route of code-first may just be perfect. Thanks Martin. – Tyler Roper Jun 11 '18 at 17:05
  • 1
    Still can't see Ado data entity model in visual studio 2019 with Asp >Net Core 3.00 project. What have to do? Is there a way? – Muhammad Ashikuzzaman May 04 '19 at 09:19
  • Since the introduction of Source Generators, I guess one can create an option for edmx to be used, but only as an "AdditionalFile" that a source generator would then read and then generate the code how the .NET Framework's ADO.NET templated did it previously. This would require knowing the ins and outs of Roslyn however (which is used internally in Visual Studio as well naturally). However I would do a different format instead, probably yaml based to make it simple to create/update using the IDE text editor. – PSXGamerPro1 Feb 27 '22 at 04:58