Tuesday, 13 March 2012



A tool which helps generate C# code from a XSD file. It can be very useful to generate classes which have a long list of properties - and you want to add WCF DataContract attributes, INotifyProperty code on these properties.

It also can be used when your application has lots of reference data. We can manually create XSD file with the reference data as enumeratio, then generate the class - and use this class in application. The class can be serialized and loaded back again if new items can be added by user.

There is also an option to auto-generate the classes if XSD file changes, I believe this requires installing a VS plug-in. The classes generated are partial classes, we can create another partial classes with same name if we want to add our own business rules.

#read: Code Generation in the .NET Framework Using XML Schema

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

C# Reactive Extensions - Buffer and Window

I was going through Buffer and Window in RX, thought a few examples would help clear the differences. First create a buffer of even numbe...