Linked Questions

2 votes
0 answers
769 views

Pertinent sections of the class I'm trying to serialize/deserialize: public class SampleClass { [JsonPropertyName("DimensionValueDictionary")] public Dictionary<string, List<...
hexcode's user avatar
  • 413
0 votes
1 answer
77 views

So I have the following data structure defined in my program: Dictionary<string, Dictionary<List<string>, int>> myTopDict = new Dictionary<string, Dictionary<List<string>,...
Rahul Sharma's user avatar
  • 8,377
0 votes
0 answers
39 views

My JSON looks like: [ { "Key": { "PatientName": "Hans Gerd", "Alter": 81, "Geschlecht": "M", "...
Xelia's user avatar
  • 1
8 votes
2 answers
8k views

How can I make Json.NET serializer to serialize IDictionary<,> instance into array of objects with key/value properties? By default it serializes the value of Key into JSON object's property ...
eXavier's user avatar
  • 5,011
3 votes
1 answer
24k views

I need to remove some newline characters from some string values while serializing to JSON -- i.e. during c# object to JSON conversion. How can this be done? public static string ToJson(this object ...
Govind's user avatar
  • 989
1 vote
3 answers
8k views

I've a problem converting a dictonairy to JSON.NET. I'm sure i'm missing some points. Also my experience in working with JSON is small and I mostly did it from php not from c#. It adds &qout i'm ...
JochemQuery's user avatar
  • 1,567
3 votes
2 answers
5k views

I get an error when deserializing a dictionary with value tuple keys. I think it converts the tuple into a string then is unable to deserialize it back as a key: Newtonsoft.Json....
herme 0's user avatar
  • 982
1 vote
2 answers
4k views

Say, we have that code: var tuple = new Tuple<double, int>(10.6, 2); var tupleString = tuple.ToString(); //returns "(10.6, 2)"; Can we get a new Tuple instance from tupleString without ...
Vladislav Shirshakov's user avatar
4 votes
3 answers
3k views

I am developing a game which has a class called UserInfo. Inside the UserInfo class there is a public List<Lineup> lineups variable. And Lineup contains public Dictionary<Vector2Int, ...
Seaky's user avatar
  • 249
3 votes
1 answer
709 views

I'm working on a custom JsonConverter, and override the CanConvert-method. public override bool CanConvert(Type objectType) { return (typeof(IDictionary).IsAssignableFrom(objectType) || ...
smoksnes's user avatar
  • 10.9k
2 votes
1 answer
1k views

I've been struggling to deserialize a Dictionary with Enum Tuple keys in Json.Net. The main problem is that the deserializer can't convert the values back to the specified Enum Tuple whether it's the ...
ucsongi's user avatar
  • 31
3 votes
1 answer
615 views

I would like to have a serialization format that is nearly identical to JSON, except that key-values are represented as <key>="<value>" instead of "<key>":"<value>". With ...
Brent Arias's user avatar
  • 30.3k
4 votes
0 answers
591 views

I am using Web API service. My class is as follows public class MyClass { public Dictionary<MyClass, List<MyClass>> MyDataDictionary { get; set; } public string Id { get; set; } ...
Pavan's user avatar
  • 1,083
0 votes
0 answers
566 views

I would like to serialize Dictionary with complex key to JSON by serializing it as a list of KeyValuePair and deserialize it back to dictionary using Json.Net's JsonConverter. I use this Dictionary ...
Bartek Chyży's user avatar
1 vote
0 answers
377 views

I'm trying to serialize a nested dictionary of int arrays (<int[], <int[], int>>) with Json.net but when I run it through the serializer: string dumpFile = JsonConvert.SerializeObject(...
EVG Labs's user avatar
  • 623

15 30 50 per page