Suchiman
Suchiman

Reputation: 1776

xsd.exe Auto-Implemented Properties

Is it possible to force xsd.exe to generate auto-implemented properties instead of the ugly manually implemented code which xsd.exe generates?

public abstract partial class SomeClass {

    private string valueField;

    /// <remarks/>
    [System.Xml.Serialization.XmlTextAttribute()]
    public string Value {
        get {
            return this.valueField;
        }
        set {
            this.valueField = value;
        }
    }
}

Upvotes: 8

Views: 2834

Answers (1)

It seems XML Schema Definition Tool (Xsd.exe) does not support generating auto-implemented properties.

But there is an alternative: Xsd2Code community edition. From feature list:

Support automatic properties when no special get or set is required.

Related answer: XSDObjectGen.exe vs XSD.exe.

Upvotes: 11

Related Questions