XmlSchemaClassGenerator
A console tool and library that generates XmlSerializer-compatible C# classes from XML Schema (XSD) files, with data annotations, nullable adapters, and optional Entity Framework support.
XmlSchemaClassGenerator generates C# classes compatible with XmlSerializer from XML Schema files. It maps XML namespaces to C# namespaces, generates XML documentation comments from schema annotations, and adds DataAnnotations attributes or custom attributes for restrictions that DataAnnotations does not cover.
It maps XML integer types to the closest .NET numeric type, falling back to string when no exact match exists, generates automatic properties in Pascal case, and can produce nullable adapter properties for optional elements without a default value. Optional features include support for INotifyPropertyChanged, Entity Framework Code First key generation, interfaces for groups and attribute groups, and one generated file per class. It does not support every XML Schema restriction type, and some recursive or unusual group structures are unsupported.
It is available as downloadable binaries, as a .NET Core CLI tool, and as a NuGet package.