How to specify an attribute in XSD so that when C# classes are generated using XSD tool that particular attribute is generated as property with XMLIgnore attribute?
How to tweak XSD or generation of C# code to get something like this,
[Serializable]
public class Person {
public string Name { get; set; }
[XmlIgnore]
public string NickName { get; set; }
}
By definition,
XmlIgnoreis for things that aren’t related to the xsd, so xsd is never going to generate a member that it doesn’t know about. If you have a requirement to add non-xml-related members to the xsd-generated type, that is where apartial classcomes in, i.e. in a separate code file (specifying the name c# namespace):note that the other .cs file (from the xsd) has the
.Nameetc