question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C# Dictionaries - not supported?

See original GitHub issue

Hi,

I’ve been trying to work with models which looks similar to this:

{ "101": "Something", "102": "Something else", "109": "Something else yet again }

My C# model maps this to a Dictionary<int, string>. Am I correct when I say this isn’t supported with your library? The keys in the dictionary are dynamic, so there’s no option to create a model type which matches these.

Edit: Just to clarify, I’m trying to apply a patch in C# using this model, which I haven’t been able to make work. The same patch applied in JS works as expected.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KevinDockxcommented, Nov 2, 2017

This is now supported.

0reactions
mtzaldocommented, Jul 18, 2017

@CRidge the gist that i put is an example how an instatiated obj can be translated into a json patch. The patched doc is being generated from the properties automatically

@kevindockx if you have more information about it, and a resource I can read, I can throw some time and work on it. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dictionary .Add not supported C# - Stack Overflow
A Dictionary can be iterated over as collection of key/value pairs, so you can do this: while (condition) { response = // call...
Read more >
Dictionary<TKey,TValue> Class
Represents a collection of keys and values.
Read more >
C# Dictionary with examples
In Dictionary, key must be unique. Duplicate keys are not allowed if you try to use duplicate key then compiler will throw an...
Read more >
Dictionaries in Python
Duplicate keys are not allowed. A dictionary maps each key to a corresponding value, so it doesn't make sense to map a particular...
Read more >
Dictionary | Apple Developer Documentation
Overview. A dictionary is a type of hash table, providing fast access to the entries it contains. Each entry in the table is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found