XmlSchema generation

The .NET framework supports XmlSchema attributes to allow static members to define a custom schema method required for WCF serialization. Unfortunately this cannot be implemented in Catel itself because it would required too much reflection and the method is static. Therefore this feature included in Catel.Fody.

There is no need to enable this feature because it is automatically enabled when Catel.Fody is added to a project.

When the XmlSchemaProvider is available on the target platform where Catel is used, the changes will be made to classes deriving from ModelBase:

1. Decorate the class with XmlSchemaProvider attribute:

[XmlSchemaProvider("GetXmlSchemaForCatelFodyTestAssemblyInheritedClass")]
public class InheritedClass : BaseClass
{
    // rest of the class definition
}

2. Implement the class specific GetXmlSchema method:

[CompilerGenerated]
public static XmlQualifiedName GetXmlSchemaForCatelFodyTestAssemblyInheritedClass(XmlSchemaSet xmlSchemaSet)
{
    Type type = typeof(InheritedClass);
    return XmlSchemaManager.GetXmlSchema(type, xmlSchemaSet);
}