views:

86

answers:

1

I have used LINQ-to-SQL in WPF and ASP.NET MVC projects in the following way:

  • create database
  • drag tables into the designer
  • use generated classes with LINQ

Now I have a project where the data sources are a mix of web services, a database, and XML files. From what I understand of Entity Framework, I can create similar classes as I can in LINQ-to-SQL but they would wrap my other sources as well (web services, XML files, etc.) However, I don't see how this would work with the convenient drag-and-drop visual designer since it wouldn't know which methods to call on my services to save the data, etc.

So I also found LINQExtender which enables you to create data providers which can be consumed by LINQ. In a sense, this is the same thing that the Entity Framework does yet it seems that it would be a way to create classes which could be used by the Entity Framework.

Are tools like LINQExtender and Entity Framework competing solutions to create data providers / ORM layer, or are they tools you would use together?

+1  A: 

The Entity Framework is an ORM, specifically designed to map database entities to objects. It is only for databases. On the other hand, LINQExtender is not specific to databases, and can be used to create Linq providers for any kind of data source.

Thomas Levesque
but doesn't the fact the EF is able to "target any ADO.NET data provider" (http://stackoverflow.com/questions/8676/entity-framework-vs-linq-to-sql/8686#8686) which L2S cannot, doesn't this make EF able to wrap any datasource which can be access via an ADO.NET data provider, e.g. XML, CSV, or any web service (http://msdn.microsoft.com/en-us/magazine/cc301611.aspx)
Edward Tanguay
Well, ADO.NET can access database-like data sources... that could include XML or web-services, IF an ADO.NET provider for these data sources exist, and IF they can be manipulated as a relational database (which isn't always the case). AFAIK, Entity Framework can only access data sources with a relational structure.
Thomas Levesque
For Entity Framework to be able to access a database you need an ADO.NET Provider that supports 3.5 features - i.e. specific EF support. You can't just throw CSV at it.
DamienG