You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use MemberVisitor to apply additional attributes based on documented rules that are not present in the XSD schema. One roadblock I've run into is that text value properties are not passed into the visitor action. Consider the following schema:
This generates a C# class with a Currency property and a Value property. I want to add [Column(TypeName = "decimal(12,2)")] on Value because it's type is MonetaryAmount, but I never get the chance.
Also consider the following C# properties that were generated:
[System.ComponentModel.DataAnnotations.Schema.NotMappedAttribute()][System.Xml.Serialization.XmlElementAttribute("MyDate", DataType="date")]public System.DateTime MyDateValue {get;set;}/// <summary>/// <para xml:lang="de">Ruft einen Wert ab, der angibt, ob die MyDate-Eigenschaft spezifiziert ist, oder legt diesen fest.</para>/// <para xml:lang="en">Gets or sets a value indicating whether the MyDate property is specified.</para>/// </summary>[System.Xml.Serialization.XmlIgnoreAttribute()][System.ComponentModel.DataAnnotations.Schema.NotMappedAttribute()][System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]publicbool MyDateValueSpecified {get;set;}[System.Xml.Serialization.XmlIgnoreAttribute()]public System.Nullable<System.DateTime>MyDate{get{if(this.MyDateValueSpecified){returnthis.MyDateValue;}
else
{returnnull;}}
set
{this.MyDateValue = value.GetValueOrDefault();this.MyDateSpecified = value.HasValue;}}
I would like to add [Column(TypeName = "date")] to MyDate because it's XML type is date and to use it with Entity Framework. However, that property is never passed into the MemberVisitor action. The other two properties are, but EF will (correctly) ignore those properties.
The text was updated successfully, but these errors were encountered:
I am trying to use MemberVisitor to apply additional attributes based on documented rules that are not present in the XSD schema. One roadblock I've run into is that text value properties are not passed into the visitor action. Consider the following schema:
This generates a C# class with a
Currency
property and aValue
property. I want to add[Column(TypeName = "decimal(12,2)")]
onValue
because it's type isMonetaryAmount
, but I never get the chance.Also consider the following C# properties that were generated:
I would like to add
[Column(TypeName = "date")]
toMyDate
because it's XML type isdate
and to use it with Entity Framework. However, that property is never passed into theMemberVisitor
action. The other two properties are, but EF will (correctly) ignore those properties.The text was updated successfully, but these errors were encountered: