public bool IsEmpty(object value) { Type type = value.GetType(); PropertyInfo pi = type.GetProperty("HasValue"); return (bool)pi.GetValue(value, null); }