7 instantiations of SqlBinary
System.Data.Common (7)
System\Data\Common\SQLConvert.cs (1)
569
return new
SqlBinary
(Convert.FromBase64String((string)value));
System\Data\SQLTypes\SQLBinary.cs (5)
106
public static implicit operator SqlBinary(byte[] x) => new
SqlBinary
(x);
138
return new
SqlBinary
(rgbResult);
198
return x.IsNull ? SqlBinary.Null : new
SqlBinary
(x.ToByteArray());
465
return new
SqlBinary
(bytes, copy: false);
472
public static readonly SqlBinary Null = new
SqlBinary
(null, copy: false);
System\Data\SQLTypes\SQLBytes.cs (1)
434
return IsNull ? SqlBinary.Null : new
SqlBinary
(Value);
98 references to SqlBinary
netstandard (1)
netstandard.cs (1)
573
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.
SqlBinary
))]
System.Data (1)
src\libraries\shims\System.Data\ref\System.Data.cs (1)
229
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.
SqlBinary
))]
System.Data.Common (96)
System\Data\ColumnTypeConverter.cs (1)
46
typeof(
SqlBinary
),
System\Data\Common\DataStorage.cs (1)
95
typeof(
SqlBinary
),
System\Data\Common\SQLConvert.cs (5)
275
public static
SqlBinary
ConvertToSqlBinary(object value)
280
return
SqlBinary
.Null;
287
StorageType.SqlBinary => (
SqlBinary
)value,
289
_ => throw ExceptionBuilder.ConvertFailed(valueType, typeof(
SqlBinary
)),
657
return Convert.ToBase64String(((
SqlBinary
)value).Value);
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (13)
16
private
SqlBinary
[] _values = default!; // Late-initialized
18
public SqlBinaryStorage(DataColumn column) : base(column, typeof(
SqlBinary
),
SqlBinary
.Null,
SqlBinary
.Null, StorageType.SqlBinary)
47
throw ExprException.Overflow(typeof(
SqlBinary
));
60
return _values[recordNo].CompareTo((
SqlBinary
)value);
101
SqlBinary
newValue = default;
111
return ((
SqlBinary
)tmp);
119
Debug.Assert((value.GetType() == typeof(
SqlBinary
)), "wrong input type");
132
return new
SqlBinary
[recordCount];
137
SqlBinary
[] typedStore = (
SqlBinary
[])store;
144
_values = (
SqlBinary
[])store;
System\Data\Common\SQLTypes\SQLBytesStorage.cs (2)
99
SqlBinary
newValue = default;
109
return (new SqlBytes((
SqlBinary
)tmp));
System\Data\SQLTypes\SQLBinary.cs (63)
15
public struct SqlBinary : INullable, IComparable, IXmlSerializable, IEquatable<
SqlBinary
>
21
/// Initializes a new instance of the <see cref='
SqlBinary
'/> class with a binary object to be stored.
38
/// Initializes a new instance of the <see cref='
SqlBinary
'/> class with a binary object to be stored. This constructor will not copy the value.
104
/// Converts a binary object to a <see cref='
SqlBinary
'/>.
106
public static implicit operator
SqlBinary
(byte[] x) => new SqlBinary(x);
111
/// Converts a <see cref='
SqlBinary
'/> to a binary object.
113
public static explicit operator byte[]?(
SqlBinary
x) => x.Value;
116
/// Returns a string describing a <see cref='
SqlBinary
'/> object.
126
/// Adds two instances of <see cref='
SqlBinary
'/> together.
129
public static
SqlBinary
operator +(
SqlBinary
x,
SqlBinary
y)
194
/// Converts a <see cref='System.Data.SqlTypes.SqlGuid'/> to a <see cref='
SqlBinary
'/>.
196
public static explicit operator
SqlBinary
(SqlGuid x) // Alternative method: SqlGuid.ToSqlBinary
198
return x.IsNull ?
SqlBinary
.Null : new SqlBinary(x.ToByteArray());
205
/// Compares two instances of <see cref='
SqlBinary
'/> for equality.
207
public static SqlBoolean operator ==(
SqlBinary
x,
SqlBinary
y)
216
/// Compares two instances of <see cref='
SqlBinary
'/>
219
public static SqlBoolean operator !=(
SqlBinary
x,
SqlBinary
y)
225
/// Compares the first <see cref='
SqlBinary
'/> for being less than the
226
/// second <see cref='
SqlBinary
'/>.
228
public static SqlBoolean operator <(
SqlBinary
x,
SqlBinary
y)
237
/// Compares the first <see cref='
SqlBinary
'/> for being greater than the second <see cref='
SqlBinary
'/>.
239
public static SqlBoolean operator >(
SqlBinary
x,
SqlBinary
y)
248
/// Compares the first <see cref='
SqlBinary
'/> for being less than or equal to the second <see cref='
SqlBinary
'/>.
250
public static SqlBoolean operator <=(
SqlBinary
x,
SqlBinary
y)
260
/// Compares the first <see cref='
SqlBinary
'/> for being greater than or equal the second <see cref='
SqlBinary
'/>.
262
public static SqlBoolean operator >=(
SqlBinary
x,
SqlBinary
y)
276
public static
SqlBinary
Add(
SqlBinary
x,
SqlBinary
y)
281
public static
SqlBinary
Concat(
SqlBinary
x,
SqlBinary
y)
287
public static SqlBoolean Equals(
SqlBinary
x,
SqlBinary
y)
293
public static SqlBoolean NotEquals(
SqlBinary
x,
SqlBinary
y)
299
public static SqlBoolean LessThan(
SqlBinary
x,
SqlBinary
y)
305
public static SqlBoolean GreaterThan(
SqlBinary
x,
SqlBinary
y)
311
public static SqlBoolean LessThanOrEqual(
SqlBinary
x,
SqlBinary
y)
317
public static SqlBoolean GreaterThanOrEqual(
SqlBinary
x,
SqlBinary
y)
337
if (value is
SqlBinary
i)
341
throw ADP.WrongType(value!.GetType(), typeof(
SqlBinary
));
344
public int CompareTo(
SqlBinary
value)
360
value is
SqlBinary
other && Equals(other);
365
public bool Equals(
SqlBinary
other) =>
463
public static
SqlBinary
WrapBytes(byte[] bytes)
470
/// instance of the <see cref='
SqlBinary
'/> class.
472
public static readonly
SqlBinary
Null = new SqlBinary(null, copy: false);
System\Data\SQLTypes\SQLBytes.cs (5)
85
public SqlBytes(
SqlBinary
value) : this(value.IsNull ? null : value.Value!)
432
public
SqlBinary
ToSqlBinary()
434
return IsNull ?
SqlBinary
.Null : new SqlBinary(Value);
442
public static explicit operator
SqlBinary
(SqlBytes value)
448
public static explicit operator SqlBytes(
SqlBinary
value)
System\Data\SQLTypes\SQLGuid.cs (3)
154
public static explicit operator SqlGuid(
SqlBinary
x)
246
public
SqlBinary
ToSqlBinary()
248
return (
SqlBinary
)this;
System\Data\SQLTypes\SQLString.cs (1)
917
return
SqlBinary
.HashByteArray(rgbSortKey, rgbSortKey.Length);
System\Data\TypeLimiter.cs (1)
151
typeof(
SqlBinary
),
System\Data\xmlsaver.cs (1)
269
if (type == typeof(
SqlBinary
))