Reputation: 691
We have been working on a .NET 2.0 solution loaded in VS 2010. Our IDE allows us to write Lambda Expression, LINQ queries, etc., eventhough our project framework is set to 2.0 (I could see the .NET Framework version in the project properties).
We are able to implement Predicate against our List. I wonder how it is possible when our project framework is 2.0 which is loaded in Visual Studio 2010.
Please advise.
Upvotes: 0
Views: 775
Reputation: 1500055
Lambda expressions and even query expressions are C# features, not framework features. When expression trees aren't available, you can still write lambda expressions which convert to delegate types. List<T>
and Predicate
existed in .NET 2.0, so it's fine. If you use something like LINQBridge you can even use LINQ to Objects in .NET 2.0, and I believe there are ways of even using Mono's implementation of expression trees against .NET 2.0.
I have a short page listing which C# 3 features are available when targeting .NET 2.0. At some point I should update it with a similar analysis for C# 4 features against earlier versions.
Upvotes: 3