什么是Visual Studio 2017中用于实体框架``数据库优先''的替代品 [英] What is the replacement in Visual Studio 2017 for Entity Framework 'database first'

查看:85
本文介绍了什么是Visual Studio 2017中用于实体框架``数据库优先''的替代品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题-我正在Visual Studio 2017中工作,虽然我知道EF中的数据库优先"方法已不存在,但我想知道替换方法是什么.我特别想做的是从现有数据库生成类.我看到了: EntityFramework反向POCO生成器-这是正确的选择,还是我应该使用VS2017中的某些内容吗?我认为这将是显而易见的信息,也许我在找错了地方...

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

注意:我有一个ASP.NET Core项目,但不是使用EF Core.我正在针对完整的.NET框架和EF6使用ASP.NET Core.

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.

推荐答案

您需要为EF6代码创建.NET类库,并且可以向其中添加实体数据模型(使用数据库优先),或使用EF反向POCO也是如此,但是它必须是基于csproj的标准老式项目.

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.

这篇关于什么是Visual Studio 2017中用于实体框架``数据库优先''的替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆