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
{{ message }}
Repository navigation
QUESTION: Generate as XmlCdataSection for primate strings/named properties? #547
Is there a way to have specified properties, or all primitive strings generate as XMLCdataSections?
Currently, I'm having to generate an additional partial class and remember to add an [XMLIgnore] and match the order in the generated partial class (each time I regenerate), which is a little cumbersome but works.
Any better approaches?
Additional partial
/// <summary>/// Update the generated code to ignore the default/// [XmlIgnore] public string summary/// </summary>[System.ComponentModel.DataAnnotations.MaxLengthAttribute(1000)][System.ComponentModel.DataAnnotations.RequiredAttribute(AllowEmptyStrings=true)][System.Xml.Serialization.XmlElementAttribute("summary",Order=10,Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]publicXmlCDataSectionSummaryCData{get{
var doc =new XmlDocument();returndoc.CreateCDataSection(Summary);}set{Summary=value?.Value;}}
Activity
mganss commentedon Mar 6, 2025
There is currently no support for this. PRs welcome 😄