How can this be?
What am I missing?
They're currently boxed into object
, and those two objects are not the same object, which means ==
fails. If you unbox them to int
, then it will succeed:
(int)model.value == (int)model.metadata.Model // true
Or you could call Equals
which should work:
model.value.Equals(model.metadata.Model) // true
== Operator Only if operands are Value Types and their values are equal, it returns true else false