title: How to restrict serialization for the property type Guid?
body: <pre><code>    public class Pet
      {
        // The default value for the Animal field is "Dog". 
        [DefaultValue(0)]
        public int testinteger { get; set; }
  
        [DefaultValue (00000000 - 0000 - 0000 - 0000 - 000000000000)]
        public Guid testbool { get; set; }
      }
  
      public class Run
     {
      public static void Main()
      {
          Run test = new Run();
  
          test.SerializeObject("OverrideDefaultValue.xml");
      }
  
      public void SerializeObject(string filename)
      {
          XmlSerializer mySerializer = new XmlSerializer(typeof(Pet));
          TextWriter writer = new StreamWriter(filename);
          Pet myPet = new Pet();
          myPet.testinteger = 10;
          mySerializer.Serialize(writer, myPet);
          writer.Close();
      }
    } 
  </code></pre>
  
  <p>Here i have used Id property for serialization. I have used the attribute default value. But serialization is not restricted for Id property.</p>