Purpose of EF 6.x DbContext Generator option when adding a new data item in Visual Studio(在 Visual Studio 中添加新数据项时 EF 6.x DbContext Generator 选项的用途)
问题描述
我有一个使用 LINQ to SQL 构建的 Web 应用程序,我希望将其升级到 LINQ to Entity Framework.我查看了一些教程,我了解到基本上在数据库优先的场景中,您创建了一个 ADO.NET 实体数据模型.然后,您可以选择要包含在模型中的表(与 LINQ to SQL 非常相似).
I have a web app that I built using LINQ to SQL and I'm looking to upgrade it to LINQ to Entity Framework. I've looked at some tutorials and what I've learned is that basically in the database-first scenario, you create an ADO.NET Entity Data Model. And from there, you select which tables to include in the model (very similar to LINQ to SQL).
在添加新项目对话框中,我看到还有另一个选项可以创建EF 6.x DbContext Generator:
Within the Add New Item dialog, I see that there is another option that creates an EF 6.x DbContext Generator:
与 ADO.NET 实体数据模型(对话框中的第一个选项)相比,EF 6.x DbContext Generator 的目的是什么?而且,EF 6.x DbContext Generator 有什么用?它似乎创建了一个文本文件.我该怎么办?
What is the purpose of EF 6.x DbContext Generator compared to ADO.NET Entity Data Model (first option in dialog)? And, what is EF 6.x DbContext Generator for? It seems to create a text file. What should I do with it?
推荐答案
如果您已经有一个数据库,那么第一个选项更好,因为该方法与您已经在 LinqToSQL 中使用的方法非常相似..EDMX 文件还可以为您提供数据库的图形可视化,而您不必担心其他任何事情.
If you already have a database, the first option is better, given that the approach is very similar to the one you are already working in LinqToSQL. The .EDMX file also can provide you a graphical visualization of your database, and you don't have to worry about anything else.
这篇关于在 Visual Studio 中添加新数据项时 EF 6.x DbContext Generator 选项的用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Visual Studio 中添加新数据项时 EF 6.x DbContext G
基础教程推荐
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
