Q:

Comparing the value of a property in two instances

I think I'm having boxing issues
foreach(var p in item.GetType().GetProperties().
    Where(p => p.GetValue(original, null) is ValueType))
{
    var originalValue = p.GetValue(original, null);
    var modifiedValue = p.GetValue(item, null);
    if (!originalValue.Equals(modifiedValue)) 
        kvpData.AppendFormat("{0}={1}&", p.Name, originalValue);
}

originalValue is never equal to modifiedValue, Im guessing it's because they are boxed inside Object. But how do I fix it?

A:

It is not a boxing issue. Equals is a virtual method, which the boxed value types override just fine.
However, I am not sure what the issue is. Could it be that there aren’t actually any matching properties? Remember that GetProperties() without any parameters will only return public properties. If the properties you need are private, you need to add some BindingFlags:
GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)

(I’m assuming here that you don’t want static properties.)
Are you also sure that it is actually properties that you are after and not fields? Remember that if you declare something as
public string Name;

then it’s a field, whereas
public string Name { get; set; }

is a property. If it’s actually fields you need, you need to use GetFields() instead of GetProperties() with the same binding flags.

