I'm currently working on a .net 4.6.2 application.
I need to serialize an OData Api call and it works perfectly fine.
Unfortunately I'm getting a Sonar Qube Error:
Update this implementation of 'ISerializable' to conform to the recommended serialization pattern.
To get my OData into C#, I use the following class structure:
[Serializable]
public class Record : Dictionary<string, dynamic> { }
[DataContract]
public class Records
{
[DataMember(Name = "@odata.context")]
public string Context { get; set; }
[DataMember(Name = "@odata.count")]
public int Count { get; set; }
[DataMember(Name = "value")]
public IEnumerable<Record> Value { get; set; }
}
The serialization works fine, but I don't know how to solve this Sonar Qube error.
How to properly use ISerializable together with DataContract, is it actually possible?
Do you know how to solve this issue?
As suggested by @Maritn Costello
you could suppress this warning like this.
Dictionary class implement
ISerializable