I\'m looking for a way to write code that tests whether a value is boxed.
My preliminary investigations indicate that .NET goes out of its way to conceal the fact,
I'm not sure if this will be relevant to anyone, but since I encountered this post because boxing was actually impacting my very dynamic mapping.
Sigil proivdes a fantastic UnBoxAny method
Assuming you have the following:
public class Report { public decimal Total { get; set; } }
new Dictionary
So the decimal value is boxed.
var totalProperty = typeof(Report).GetProperty("Total");
var value = emit.DeclareLocal
* invoke TryGetValue
** use in If/Else