internal bool CompareValueTo(int record1, object value, bool checkType)
{
// this method is used to make sure value and exact type match.
int valuesMatch = CompareValueTo(record1, value);
// if values match according to storage, do extra checks for exact compare
if (valuesMatch == 0)
{
Type leftType = value.GetType();
Type rightType = _storage.Get(record1).GetType();
// if strings, then do exact character by character check
if (leftType == typeof(string) && rightType == typeof(string))
{
return string.CompareOrdinal((string)_storage.Get(record1), (string)value) == 0 ? true : false;
}
// make sure same type
else if (leftType == rightType)
{
return true;
}
}
return false;
}