System.Data.SqlClient.SqlParameter.GetMetaTypeOnly C# (CSharp) Méthode

GetMetaTypeOnly() private méthode

private GetMetaTypeOnly ( ) : MetaType
Résultat MetaType
        private MetaType GetMetaTypeOnly()
        {
            if (null != _metaType)
            {
                return _metaType;
            }
            if (null != _value && DBNull.Value != _value)
            {
                // We have a value set by the user then just use that value
                // char and char[] are not directly supported so we convert those values to string
                if (_value is char)
                {
                    _value = _value.ToString();
                }
                else if (Value is char[])
                {
                    _value = new string((char[])_value);
                }
                return MetaType.GetMetaTypeFromValue(_value, inferLen: false);
            }
            else if (null != _sqlBufferReturnValue)
            {  // value came back from the server
                Type valueType = _sqlBufferReturnValue.GetTypeFromStorageType(_isSqlParameterSqlType);
                if (null != valueType)
                {
                    return MetaType.GetMetaTypeFromType(valueType);
                }
            }
            return MetaType.GetDefaultMetaType();
        }