I was pleasantly surprised a few months ago to learn that I could use many C# 3.x constructs (anonymous types, lambdas, automatic properties) in .NET 2.0, due to the fact that they all compile to the same IL…in effect, syntactic sugar.
Is this also the case of LINQ and XLINQ? Can i use these constructs while still targeting .NET 2.0 runtimes?
For info, much of the core of LINQ is available in .NET 2.0 (with C# 3.0) via (for example) LINQBridge. This gives you most of LINQ-to-Objects (allowing query syntax against in-memory collections/iterators), but it doesn’t provide the new assemblies required for LINQ-to-XML or LINQ-to-SQL etc.
So no; you can’t use
XDocumentwithout the new assemblies from .NET 3.5; but you can do many LINQ things.