Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConvertToSqlInt64()

static SqlInt64 System.Data.Common.SqlConvert.ConvertToSqlInt64 ( object value)
inlinestatic

Definition at line 62 of file SqlConvert.cs.

63 {
64 if (value == DBNull.Value)
65 {
66 return SqlInt32.Null;
67 }
68 Type type = value.GetType();
69 return DataStorage.GetStorageType(type) switch
70 {
72 StorageType.Int64 => (long)value,
74 StorageType.Int16 => (short)value,
75 StorageType.UInt16 => (ushort)value,
76 StorageType.SqlInt32 => (SqlInt32)value,
77 StorageType.Int32 => (int)value,
78 StorageType.UInt32 => (uint)value,
80 StorageType.Byte => (byte)value,
81 _ => throw ExceptionBuilder.ConvertFailed(type, typeof(SqlInt64)),
82 };
83 }
static readonly SqlInt32 Null
Definition SqlInt32.cs:19

References System.Data.ExceptionBuilder.ConvertFailed(), System.Xml.Dictionary, System.Data.Common.DataStorage.GetStorageType(), System.Type.GetType(), System.Data.SqlTypes.SqlInt32.Null, System.Data.Common.SqlByte, System.Data.Common.SqlInt16, System.Data.Common.SqlInt64, System.type, System.DBNull.Value, and System.value.

Referenced by System.Data.BinaryNode.BinaryCompare(), System.Data.Common.SqlConvert.ChangeType2(), System.Data.Common.SqlInt64Storage.ConvertValue(), System.Data.BinaryNode.EvalBinaryOp(), and System.Data.Common.SqlInt64Storage.Set().