navigation
 Wednesday, October 01, 2008

I recently discovered that I can actually use most of my favorite C# 3.0 language features even in projects that target .NET Framework 2.0. For some of you, this is probably a 'duh, of course you can, those are compiler features, not framework features!', but for those of you out there like me that didn't cotton on to this, I hope this blog will be good news!

So, here are the features you can use:

  • object initializers
  • lambda expressions (yeah!)
  • automatic properties
  • anonymous types
  • local variable type inference

Again, this is because these features are all compiler tricks (so obviously you will need the 3.0 or 3.5 compiler). They generate the exact same IL as the 2.0 compiler would.

And here are some you cant:

  • extension methods
  • query expressions

So no Linq.

Check out this blog for more information.

 |  | 
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, i, strike, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview