Struct SpecialDbType
Allows for specifying custom DB types that are not natively mapped.
Namespace: Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations
Assembly: Umbraco.Infrastructure.dll
Syntax
public struct SpecialDbType
Constructors
View SourceSpecialDbType(string)
Initializes a new instance of the SpecialDbType class using the specified database type.
Declaration
public SpecialDbType(string dbType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | dbType | A string representing the special database type. |
SpecialDbType(SpecialDbTypes)
Initializes a new instance of the SpecialDbType class using the specified SpecialDbTypes value.
Declaration
public SpecialDbType(SpecialDbTypes specialDbTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| SpecialDbTypes | specialDbTypes | A value indicating the special database types to be used by this instance. |
Properties
View SourceNCHAR
Represents the special database type for a fixed-length Unicode character string (NCHAR).
Declaration
public static SpecialDbType NCHAR { get; }
Property Value
| Type | Description |
|---|---|
| SpecialDbType |
NTEXT
Represents the NTEXT special database type, which was used for large Unicode text data in earlier versions of SQL Server. This member is obsolete; use NVARCHARMAX instead for new development, as NTEXT is deprecated in modern SQL Server versions.
Declaration
[Obsolete("Use NVARCHARMAX instead")]
public static SpecialDbType NTEXT { get; }
Property Value
| Type | Description |
|---|---|
| SpecialDbType |
NVARCHARMAX
Represents the special database type NVARCHAR(MAX), typically used for variable-length Unicode strings with no maximum length in SQL Server.
Declaration
public static SpecialDbType NVARCHARMAX { get; }
Property Value
| Type | Description |
|---|---|
| SpecialDbType |
Methods
View SourceEquals(object?)
Determines whether the specified object is equal to the current SpecialDbType instance.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current instance; otherwise, false. |
Equals(SpecialDbType)
Determines whether the specified SpecialDbType is equal to the current instance.
Declaration
public bool Equals(SpecialDbType other)
Parameters
| Type | Name | Description |
|---|---|---|
| SpecialDbType | other | The SpecialDbType to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
ToString()
Returns the string representation of the special database type, as stored in the underlying _dbType field.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The string value of the special database type. |
Operators
View Sourceoperator ==(SpecialDbTypes, SpecialDbType)
Declaration
public static bool operator ==(SpecialDbTypes x, SpecialDbType y)
Parameters
| Type | Name | Description |
|---|---|---|
| SpecialDbTypes | x | |
| SpecialDbType | y |
Returns
| Type | Description |
|---|---|
| bool |
implicit operator string(SpecialDbType)
Declaration
public static implicit operator string(SpecialDbType dbType)
Parameters
| Type | Name | Description |
|---|---|---|
| SpecialDbType | dbType |
Returns
| Type | Description |
|---|---|
| string |
operator !=(SpecialDbTypes, SpecialDbType)
Declaration
public static bool operator !=(SpecialDbTypes x, SpecialDbType y)
Parameters
| Type | Name | Description |
|---|---|---|
| SpecialDbTypes | x | |
| SpecialDbType | y |
Returns
| Type | Description |
|---|---|
| bool |