How to use "Object" type in C# RRS feed

  • Question

  • I am assigning values to each property of my XSD class .

        [System.Xml.Serialization.XmlElementAttribute("ProductId", typeof(NumericType), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]

        [System.Xml.Serialization.XmlElementAttribute("ProductName", typeof(StandardValueType), Form =   System.Xml.Schema.XmlSchemaForm.Unqualified)]

        public object Item




                return this.itemField;




                this.itemField = value;


    Tuesday, May 21, 2019 7:53 PM

All replies

  • If the type is known e.g. StandardValueType then define the property as this type or the equivalent for C#.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Tuesday, May 21, 2019 9:42 PM
  • Hi Coding Addict,

    Thank you for posting here.

    For your question, you could refer to the link below.


    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 22, 2019 9:06 AM