Please enable YAX-Attributes inheritance...

Jun 7, 2012 at 7:56 PM

If you derive a class, only some YAXAttributes are taken into account of into the serialization:


    class TestBase
        public string Name { get; set; }

    class TestInherited : TestBase
        public string Another { get; set; }

    class Program
        static void Main(string[] args)
            var serializer = new YAXSerializer(typeof (TestInherited));
            var test = new TestInherited
                               Name = "myName",
                               Another = "one bites the dust"
            var result = serializer.Serialize(test);





<TestInherited Name="myName">
  <Another>one bites the dust</Another>

and not:

<root Name="myName">
  <Another>one bites the dust</Another>

It works, if you change this code part from UDTWrapper.cs:  


            foreach (var attr in m_udtType.GetCustomAttributes(true))
                if (attr is YAXBaseAttribute)

But i didn´t test the deserialization part, yet....


Jun 9, 2012 at 8:53 AM

Currently none of the attributes have been implemented, having inheritance in mind. This feature has been requested several times.

Thanks, and I will look for the most secure and flexible workaround.