**I Convert XSD to c# Class now when i create object of class and assign a value am getting error
Cannot implicitly convert type 'int' to 'Frameworkgo.Envelope.IdentifierTypeam doing serialization kindly help me on that
THANKYOU
- static void Main(string[] args)
- {
- ObjectEnvelopeType objectenvelopetype = new ObjectEnvelopeType();
- objectenvelopetype.DocumentReference.DocumentID = 345;
- XmlSerializer serializer = new XmlSerializer(typeof(ObjectEnvelopeType));
- FileStream fs = new FileStream("Object.xml", FileMode.Create);
- serializer.Serialize(fs, objectenvelopetype);
- fs.Close();
- Console.ReadKey();
- }
- public partial class ObjectEnvelopeType
- {
- private ReferenceType documentReferenceField;
- public ReferenceType DocumentReference{get{return this.documentReferenceField;}set{documentReferenceField = value;}}
- }
- public partial class ReferenceType
- {
- private IdentifierType documentIDField;
- public IdentifierType DocumentID{get{return documentIDField;}set{documentIDField = value;}}
- }
- public partial class DocumentReferenceType
- {
- private IdentifierType idField;
- public IdentifierType ID{get{return this.idField;}set{this.idField = value;}}
- }
- public partial class IdentifierType
- {
- private string identificationSchemeIDField;
- [System.Xml.Serialization.XmlAttributeAttribute(DataType = "normalizedString")]
- public string identificationSchemeID{get{return this.identificationSchemeIDField;}set{this.identificationSchemeIDField = value;}}
- }
Abdul SalamPosted Jun 12, 2019, 4:37 AM
Abdul SalamPosted Jun 12, 2019, 4:24 AM
Abdul SalamPosted Jun 12, 2019, 4:10 AM