C#
new gotcha
Using the new
keyword to generate a generic object
has a gotcha, the key value must be a property and not a string.
Instead you can just use a Dictionary<string, object>
to achieve the same effect, although it is more verbose.
Using the new
keyword to generate a generic object
has a gotcha, the key value must be a property and not a string.
Instead you can just use a Dictionary<string, object>
to achieve the same effect, although it is more verbose.