EF 6.x中的DbContext发生器的目的 [英] purpose of EF 6.x DbContext Generator

查看:301
本文介绍了EF 6.x中的DbContext发生器的目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我使用LINQ到SQL建立一个web应用程序,我期待将它升级到Linq到EF。我已经看了一些教程,基本上在数据库中的第一个场景,您创建一个ADO.NET实体数据模型,并从那里选择模型(非常类似于LINQ到SQL)包括哪些表。现在添加新项窗口上,我看到有这么包括创造一个EF 6.x中的DbContext发电机的另一种选择。

I have a web app that I built using Linq-to-SQL and I'm looking to upgrade it to Linq-to-EF. I've looked at some tutorials and basically in the database-first scenario, you create an ADO.NET Entity Data Model and from there select which tables to include in the model (very similar to linq-to-sql). Now on the Add New Item window, I see that there's another option that consists of creating an EF 6.x DbContext Generator.

相比,创建只是一个ADO.NET实体数据模型(窗口的第一个选项)什么的DbContext发电机的目的,什么是的DbContext发生器?这似乎是创建一个文本文件;我该怎么办呢?

What's the purpose of DbContext Generator compared to creating just an ADO.NET Entity Data Model (first option of window), and what is the 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.

这篇关于EF 6.x中的DbContext发生器的目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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