views:

1181

answers:

1

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.

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.

+4  A: 

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.

Craig Stuntz
Thanks! The SQL generation seems non-trivial. I wonder if MS collaborates with Oracle/IBM on their providers. It seems like there would be a ton of overlap for most query cases.
eyston
Well, ODBC already does a lot of SQL generation, so it would be easier with ODBC than with [insert random DB server here.]
Craig Stuntz
Still, it's kind of strange that Microsoft would just overlook this. After all, they invented ODBC, and all their database products still support it.
Matthew Flaschen