Hi,
Need some help with an application that I am working with. It's a windows service that is an integration between two different systems. I am listening for events and when an event occur I receive an XML document.
I wan't to serialize that XML document into a C# class with DataContracts.
I have a problem with serializing that XML document because the XML document consists of a XML tag with name object.
1 NorthernLights
- public class object
- {
- [DataMember(IsRequired = true)]
- public Guid Id { get; set; }
- [DataMember(IsRequired= false)]
- public string name {get; set; }
- }
I cannot create a class with name object so I wonder how to solve this?
I cannot change the XML document.

Kiran MohantyRank #821 · 2.8K reputationPosted Mar 5, 2021, 12:50 AM EST
Hakan AxheimRank #8,316 · 224 reputationPosted Mar 5, 2021, 6:35 AM EST
[DataContract(Name="object", Namespace="", IsReference=false)]
Then I can create a public class Object