Sergio Tapia
Sergio Tapia

Reputation: 41138

What is the difference between System.Linq and System.Data.Linq?

I was having troubles earlier while trying to declare a ChangeAction parameter in a method, with the IDE saying I might be missing a Namespace.

So I right click it and Resolve it and find that System.Data.Linq has been added and now everything is fine.

What is the difference between these two namespaces?

Upvotes: 25

Views: 9532

Answers (4)

kamahl
kamahl

Reputation: 941

As described here:

http://msdn.microsoft.com/en-us/library/system.data.linq.aspx

System.Data.Linq is for accessing relational data

Upvotes: 3

Thurein
Thurein

Reputation: 2566

To my understanding, System.Linq is generic-level implementation which relies on IEnumerable whereas System.Data.Linq is provider-specific (LINQ to SQL) which relies on IQueryable.

Upvotes: 2

Matt Sherman
Matt Sherman

Reputation: 8358

As I understand it, System.Linq is about the overall Linq library -- it applies to all data types like Lists and such.

System.Data.Linq is about databases (aka Linq to SQL), which includes tracking changes (ChangeAction).

Upvotes: 20

RPM1984
RPM1984

Reputation: 73112

I believe System.Linq is LINQ-OBJECTS specific (IEnumerable, IQueryable, etc)

Whilst System.Data.Linq is LINQ-SQL specific (DataContext, etc)

Upvotes: 9

Related Questions