Using Generics in BizTalk Orchestration
For whatever reason, even as we move into .NET 4 and BizTalk 2010, you still cannot create an orchestration variable of a Generic type. It is my (somewhat) humble opinion that this is a major shortcoming in XLANG. If you’re like me, you rely pretty heavily on Generics when writing collections in .NET and as such may find it pretty frustrating to work with orchestrations at times.
Fortunately folks like Andrew Rivers have presented a fairly simple solution: just create a class that inherits from the Generic type that you’re interested in and create a variable of that particular type. In a previous article , as an example, we use a Generic Dictionary object to pass facts and tag info into some code that calls the BRE. Now, we can not only use this code from a .NET client as advertised in the article, but we could also use it from Orchestration as well, which would be handy when the Call Rules shape can’t be used.