为什么实体框架不支持 ODBC? [英] Why doesn't Entity Framework support ODBC?

查看:34
本文介绍了为什么实体框架不支持 ODBC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

EF 需要新的数据提供程序而不能使用 ODBC 是否有特定原因?我认为这一定是一些 ORM 特定的问题,但 NHibernate 通过 ODBC 可以正常工作.

Is there a specific reason that the EF requires new data providers and can't make use of ODBC? I figured it had to be some ORM specific problem, but NHibernate works fine via ODBC.

我正在使用 NHibernate 并且可以继续使用 Nhibernate,但我担心我不能假设这里的任何未来程序员都具备 Nhibernate 知识.

I'm using NHibernate and can continue to use Nhibernate, but I worry that I can't assume Nhibernate knowledge for any future programmers here.

推荐答案

实体框架不需要新的数据提供者.相反,它需要扩展现有数据提供程序的实体框架提供程序,以提供实体框架所需的附加服务,例如复杂的 SQL 生成,这些服务不是现有 ADO.NET 数据模型的一部分.我认为没有什么能阻止任何人基于现有的 ADO.NET 2.0 ODBC 桥为 ODBC 编写实体框架提供程序.您可以下载示例 SQL Server 提供程序的源代码,了解有关所需服务的详细信息为实体框架扩展现有的 ADO.NET 提供程序时.

The Entity Framework doesn't require new data providers, exactly. Rather, it requires Entity Framework providers which extend existing data providers, to provide additional services required by the Entity Framework, such as complex SQL generation, which are not part of the existing ADO.NET data model. I don't think that there's anything stopping anyone from writing an Entity Framework provider for ODBC based on the existing ADO.NET 2.0 ODBC bridge. You can download the source code for a sample SQL Server provider for more information about exactly what services are required when extending an existing ADO.NET provider for the Entity Framework.

这篇关于为什么实体框架不支持 ODBC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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