Exemple #1
0
 void Write3_Products(string n, string ns, global::Catalog.Products o, bool isNullable, bool needType)
 {
     if ((object)o == null)
     {
         if (isNullable)
         {
             WriteNullTagLiteral(n, ns);
         }
         return;
     }
     if (!needType)
     {
         System.Type t = o.GetType();
         if (t == typeof(global::Catalog.Products))
         {
         }
         else
         {
             throw CreateUnknownTypeException(o);
         }
     }
     WriteStartElement(n, ns, o, false, null);
     if (needType)
     {
         WriteXsiType(@"Products", @"");
     }
     WriteElementStringRaw(@"Id", @"", System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@Id)));
     WriteElementStringRaw(@"CategoryId", @"", System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@CategoryId)));
     WriteElementString(@"Name", @"", ((global::System.String)o.@Name));
     WriteElementStringRaw(@"Price", @"", System.Xml.XmlConvert.ToString((global::System.Single)((global::System.Single)o.@Price)));
     WriteEndElement(o);
 }