Thursday, March 22, 2012

C# Expressions – Workflow Foundation in .NET 4.5

Basically, when you see a new version of the .NET Framework coming out, you think of it as “an improvement” to the previous version. With Workflow Foundation (WF) this was “brutally” different in the jump from WF3 to WF4. In this case, the version numbers just mean the version of the framework rather than a version of the WF itself (In fact, the first version of the WF was in .NET 3.0, with updates for .NET 3.5). For example, in WF4 there’s no longer a WorkflowRuntime Type and the base Activity type has nothing to do with the original one (It even resides in a totally different assembly (and namespace!): From System.Workflow.ComponentModel.dll to System.Activities.dll).

Now, having that in mind, you should look to the WF4 as a totally new approach. Consider it a new product. And looking at it as a new product, I was quite skeptical. The new XAML and Expression Based feel was not “my thing” at a first look, but I gave it a shot and I now love it.

However, one of the things that most annoyed me was the fact that all Expressions had to be written in Visual Basic, even if your entire solution was in C#. Not nice!

Now, in WF .NET 4.5… That’s about to change! You can now write your expressions using the language that you prefer! If you’re a C# fan and use C# projects, you can now write WF expressions in C#. A fully functional C# expression editor is provided with capabilities such as grammar highlighting and Intellisence.


LIKE IT? LOVE IT! Finally...


Here’s what’s new for WF in the .NET 4.5: