views:

314

answers:

6

I was just reading about Linq to SQL being discontinued. For a while I put off learning Linq at all. Even on asp.net, when I last checked, their data access tutorials were using table adapters and bll classes. Then there are linq tutorials. Now that I have read this and that the Entity Framework is the new way to go, does that mean all the Linq "stuff" I have been reading about for a year and a half, how great it is, etc., is all this just gone? No one ever seems to settle on the right way to do things or at least some standard way with MS products. And I understand that you can't say one way is right for everything. But, in this particular case I do not understand why there cannot be some settling on data access.

Or, is Linq To SQL just the ORM portion of Linq? What exactly would I learn now if I wanted to use an ORM? I have read several things on StackOverflow, but none that really help me know what to do.

It seems that nHibernate may be better than any of the Microsoft choices. Yes, I know there are others (subsonic, and others were mentioned in various SO questions.)

Thank you.

+3  A: 

Linq is much more than Linq-to-SQL. Things like Linq-to-Objects and Linq-to-XML are part of the technology, for example.

I doubt they are going away! Fingers crossed. ;-)

dommer
+4  A: 

Linq to sql is just one of many linq providers out there (there is linq to db4o, linq to starcounter, linq to objects, linq to ado and many, many more). The entity framework has its own linq provider, called linq to enteties. Your year of reading about linq is not lost.

Banang
+12  A: 

No.

LINQ to SQL is built on top of LINQ, which is one of the fundamental added language features in .NET 3.5 Framework.

Technically other ORMs can implement their own LINQ systems, e.g., NHibernate already has LINQ to NHibernate going. This is on top of the ones provided in the framework, such as LINQ to XML, LINQ to Objects etc.

Jon Limjap
There is a ridiculous number of providers, including LINQ to Twitter, etc. I dare say these are useful to someone out there. :)
ZombieSheep
LINQ to Twitter?! I should look for that. :P
Jon Limjap
http://www.codeplex.com/LinqToTwitter *sigh* - I've just died a little inside. ;)
ZombieSheep
+2  A: 

LINQ hasn't gone away. LINQ to SQL hasn't either, but it is not Microsoft's strategic platform for data access, that would be Entity Framework. EF uses LINQ to Entities so if you've spent time learning about LINQ, it'll still be valid and useful.

LINQ isn't a product-specific technology, though. It is easy to leverage the power and flexibility in collections of (almost) all kinds. eg.

List<MyType> myList = new List<MyType>();
// populate the list here
var filteredResults = from o in myList
                      where o.property == "hello world"
                      select o;

is (conceptualy) valid, even if the code example here is flawed.

ZombieSheep
+7  A: 

The Entity Framework certainly doesn't mean that LINQ is going away - the Entity Framework is a LINQ provider itself!

LINQ is a whole collection of technologies, and more than that - it's a pattern which you can implement for your own data provider as well.

LINQ to SQL is just one example of that pattern. For what it's worth, I think LINQ to SQL is being de-emphasized rather than actually going away, but we'll see...

Personally I find LINQ to Objects the most useful LINQ provider in the first place :)

Jon Skeet
A: 

LINQ is a library for processing sequences of data. And it is pretty awesome. These sequences of data may be anything that implements IEnumerable, or it may be whatever sequences are provided by adapters.

Linq to SQL is an adapter which allows a SQL database to provide sequences of data that are compatible with LINQ.

There is also a Linq to XML which is an adapter that lets you treat an XML document as a sequence of data, allowing LINQ to process it.

LINQ is just the query language, and it is extremely good at what it does. It has nothing to do with databases or SQL. It is definitely worth learning just to be able to process in-memory collections easily.

jalf