Sometimes we need to store a collection of key value pairs in dictionary with various value types. Suppose we want to store a form which consist with boolean, int, string values. Some of these values are kind of ValueType and when we cast them to a ReferenceType such as object it causes boxing.
According to these references:
Boxing and Unboxing impact our our performance such as GC pressure. The question is is there any way to avoiding boxing/unboxing in Dictionary which its TValue is object.
Dictionary<string, object>
How to avoiding boxing and unboxing in this scenario?