Compartilhar via


Linq to XSD releases Alpha today

A month ago I was investigating authoring WF rules against XML. We dont support it out of the box, but a simple way of achieving this is by exposing your XML schema as a .Net type - and then author rules against that type. Simple, and doable with XSD.exe. Then I came across the "Linq to XSD" project within Microsoft, which gives you another way of doing this - it creates a .Net type for your schema which is Linq friendly which means you get all the type-ness you get from XSD and you also get the rich query model of Linq. The Linq to XSD project template has an additional build action on your .xsd and generates the type behind the scenes and compiles it in your assembly - pretty decent integration. And then if you love the expressiveness of Linq, you can just party on the generated type.

The team has finally released a public alpha preview today so I can actually talk about this - Congrats to Ralf and his team! Check out the alpha today - you will find all you need here: https://blogs.msdn.com/xmlteam/archive/2006/11/27/typed-xml-programmer-welcome-to-linq.aspx 

If you try to get this working with a WF project template in VS, you wont be able to do so in the same project. The reason is that WF needs a C# Code Provider corresponding to the version of the C# compiler used by Linq and that's not available yet in the set up. Questions, let me know.