Entity Framework 7 Reverse Engineering ASP.NET 5

I am trying to migrate my database to a web application model using EF7 _4.

A couple of things I figured out is that the syntax / approach for setting certain objects has changed.

Typically, you create POCO classes using EF Power Tools (EF6), which generates entity types and object map as configuration. Everything is clean, everything works.

My question is: Does anyone know how to do this with EF7?

From msdn blog, I found Entity Framework 7 Beta 4 here

functions for reverse engineering are still in the standby phase. " Early preview of reverse engineering a model from a database .

+3


source to share


1 answer


Here's what will help you. As you know, it's still beta and it's a bit tricky, but the best we have at the moment.

http://stoutcloud.com/geek-out-entity-framework-7/geek-ef7-reverse-engineering-first-look/

It's just that some commands will help along the way, as they have changed a bit since they changed to DNX. You can enter Command Prompt or Powershell.

First, make sure you install the appropriate entity framework packages (as described in the previous article). Make sure you have the latest and not the beta version. I found it needed to match the DNX beta number. For example. if you get DNX beta5 you need to download nightly builds of EF beta5.

Nightly build NuGet package source for reference: https://www.myget.org/F/aspnetvnext/api/v2

Don't forget to add this to your project. json

"commands": {
    "ef": "EntityFramework.Commands"
  }

      



Now about the teams

dnvm install -r coreclr latest 

      

(or just use clr if you don't want coreClr)

Go into the project directory then enter

dnu restore

dnx . ef

dnx . ef revEng Server=PC\SQLEXPRESS;Database=Databasename;Trusted_Connection=True;

      

I heard they are working on a GUI for this, so we just have to wait and see.

+9


source







All Articles