/// <summary>
        /// Returns the object after possibly passing it to a custom user type manager for conversion.
        /// </summary>
        /// <returns>
        /// The object after custom type conversion, if a custom type for this DB returned object is registered.
        /// </returns>
        /// <param name='obj'>
        /// The value returned by the DB. This CANNOT be null.
        /// </param>
        internal static object GetSystemObjectAfterCustomTypeConversion(object obj, Type typeOfSysType, Type typeOfDbType)
        {
            TypeKey typeKey = new TypeKey(typeOfSysType, typeOfDbType);

            // If there is a custom user type
            if (RegisteredTypes.ContainsKey(typeKey))
            {
                IUserType userType = RegisteredTypes[typeKey];
                return(userType.ReadValueFromDb(obj));
            }
            else
            {
                return(obj);
            }
        }