Class SqlColumnTypeDefinitionProvider
Represents a collection of column type definitions.
public abstract class SqlColumnTypeDefinitionProvider : ISqlColumnTypeDefinitionProvider
- Inheritance
-
SqlColumnTypeDefinitionProvider
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
SqlColumnTypeDefinitionProvider(SqlColumnTypeDefinitionProviderBuilder)
Creates a new SqlColumnTypeDefinitionProvider instance.
protected SqlColumnTypeDefinitionProvider(SqlColumnTypeDefinitionProviderBuilder builder)
Parameters
builderSqlColumnTypeDefinitionProviderBuilderSource builder.
Fields
IsLocked
Specifies that new registrations are disabled for this provider.
protected bool IsLocked
Field Value
Properties
Dialect
Specifies the SQL dialect of this provider.
public SqlDialect Dialect { get; }
Property Value
Methods
Contains(ISqlColumnTypeDefinition)
Checks whether or not the specified definition belongs to this provider.
[Pure]
public bool Contains(ISqlColumnTypeDefinition definition)
Parameters
definitionISqlColumnTypeDefinitionDefinition to check.
Returns
- bool
true when
definitionbelongs to this provider, otherwise false.
CreateEnumTypeDefinition<TEnum, TUnderlying>(SqlColumnTypeDefinition<TUnderlying>)
Creates a new SqlColumnTypeDefinition<T> instance
for the TEnum type with TUnderlying type.
[Pure]
protected abstract SqlColumnTypeDefinition<TEnum> CreateEnumTypeDefinition<TEnum, TUnderlying>(SqlColumnTypeDefinition<TUnderlying> underlyingTypeDefinition) where TEnum : struct, Enum where TUnderlying : unmanaged
Parameters
underlyingTypeDefinitionSqlColumnTypeDefinition<TUnderlying>Column type definition associated with the underlying type.
Returns
- SqlColumnTypeDefinition<TEnum>
New SqlColumnTypeDefinition<T> instance.
Type Parameters
TEnumEnum type.
TUnderlyingType of the underlying value of
TEnumtype.
GetByDataType(ISqlDataType)
Returns a default column type definition associated with the provided dataType.
[Pure]
public abstract SqlColumnTypeDefinition GetByDataType(ISqlDataType type)
Parameters
typeISqlDataType
Returns
- SqlColumnTypeDefinition
Default column type definition associated with the provided
dataType.
GetByType(Type)
Returns a column type definition associated with the provided type.
[Pure]
public SqlColumnTypeDefinition GetByType(Type type)
Parameters
typeTypeRuntime type to get type definition for.
Returns
- SqlColumnTypeDefinition
Column type definition associated with the provided
type.
Exceptions
- KeyNotFoundException
When column type definition for the provided
typedoes not exist.
GetDataTypeDefinitions()
Returns a collection of all default column type definitions identifiable by ISqlDataType instances.
[Pure]
public abstract IReadOnlyCollection<SqlColumnTypeDefinition> GetDataTypeDefinitions()
Returns
- IReadOnlyCollection<SqlColumnTypeDefinition>
Collection of all default column type definitions identifiable by ISqlDataType instances.
GetTypeDefinitions()
Returns a collection of all column type definitions identifiable by Type instances.
[Pure]
public IReadOnlyCollection<SqlColumnTypeDefinition> GetTypeDefinitions()
Returns
- IReadOnlyCollection<SqlColumnTypeDefinition>
Collection of all column type definitions identifiable by Type instances.
TryAddDefinition(SqlColumnTypeDefinition)
Attempts to add a new column type definition.
protected bool TryAddDefinition(SqlColumnTypeDefinition definition)
Parameters
definitionSqlColumnTypeDefinitionDefinition to add.
Returns
- bool
true when definition was added, otherwise false.
TryCreateUnknownTypeDefinition(Type)
Attempts to create a new SqlColumnTypeDefinition instance
associated with the provided type to dynamically register.
[Pure]
protected virtual SqlColumnTypeDefinition? TryCreateUnknownTypeDefinition(Type type)
Parameters
typeTypeType to register.
Returns
- SqlColumnTypeDefinition
New SqlColumnTypeDefinition or null when column type definition for the provided
typeshould not be dynamically registered.
TryGetByType(Type)
Attempts to return a column type definition associated with the provided type.
[Pure]
public SqlColumnTypeDefinition? TryGetByType(Type type)
Parameters
typeTypeRuntime type to get type definition for.
Returns
- SqlColumnTypeDefinition
Column type definition associated with the provided
typeor null when column type definition for the providedtypedoes not exist.