MissingProperty Sample

Back to summary

Source

#if HELPER_ASSEMBLY
using System;

namespace XmlSerializersTest.Samples
{
    public class MissingProperty
    {
        public string PropertyA { get; set; }
#if VERSION_1_0
        public string PropertyB { get; set; }

        public static MissingProperty GetInstance() 
        {
            return new MissingProperty { PropertyA = "a", PropertyB = "b" };
        }
#endif
    }
}
#endif

WCF-ref Serializer

<MissingProperty xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://schemas.datacontract.org/2004/07/XmlSerializersTest.Samples">
  <PropertyA z:Id="2">a</PropertyA>
  <PropertyB z:Id="3">b</PropertyB>
</MissingProperty>