我使用 Xsd2Code 生成类。然而,其中一个类导致我的构造函数出现问题,因为循环并抛出 StackOverflowException。
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.32990")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = true)]
public partial class ApproverType : INotifyPropertyChanged
{
private ApproverType replacesField;
public ApproverType()
{
this.replacesField = new ApproverType();
}
public ApproverType Replaces
{
get
{
return this.replacesField;
}
set
{
if ((this.replacesField != null))
{
if ((replacesField.Equals(value) != true))
{
this.replacesField = value;
this.OnPropertyChanged("Replaces");
}
}
else
{
this.replacesField = value;
this.OnPropertyChanged("Replaces");
}
}
}
}