IConventionElementType Interface

Definition

Represents the elements of a collection property.

public interface IConventionElementType : Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyElementType
type IConventionElementType = interface
    interface IReadOnlyElementType
    interface IReadOnlyAnnotatable
    interface IConventionAnnotatable
Public Interface IConventionElementType
Implements IConventionAnnotatable, IReadOnlyElementType
Implements

Remarks

This interface is used during model creation and allows the metadata to be modified. Once the model is built, IElementType represents a read-only view of the same metadata.

See Model building conventions for more information and examples.

Properties

Builder

Gets the builder that can be used to configure this element.

ClrType

The type of elements in the collection.

(Inherited from IReadOnlyElementType)
CollectionProperty

Gets the collection property for which this represents the element.

IsInModel

Indicates whether this object is in a model, i.e. hasn't been removed from one.

(Inherited from IConventionAnnotatable)
IsNullable

Gets a value indicating whether elements of the collection can be null.

(Inherited from IReadOnlyElementType)
Item[String]

Gets the value of the annotation with the given name, returning null if it does not exist.

(Inherited from IReadOnlyAnnotatable)

Methods

AddAnnotation(String, Object, Boolean)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from IConventionAnnotatable)
AddAnnotations(IEnumerable<IConventionAnnotation>, Boolean)

Adds annotations to an object.

(Inherited from IConventionAnnotatable)
AnnotationsToDebugString(Int32)

Gets the debug string for all annotations declared on the object.

(Inherited from IReadOnlyAnnotatable)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from IConventionAnnotatable)
FindTypeMapping()

Returns the type mapping for elements of the collection.

(Inherited from IReadOnlyElementType)
GetAnnotation(String)

Gets the annotation with the given name, throwing if it does not exist.

(Inherited from IConventionAnnotatable)
GetAnnotations()

Gets all annotations on the current object.

(Inherited from IConventionAnnotatable)
GetConfigurationSource()

Returns the configuration source for this element.

GetIsNullableConfigurationSource()

Returns the configuration source for IsNullable.

GetIsUnicodeConfigurationSource()

Returns the configuration source for IsUnicode().

GetJsonValueReaderWriter()

Gets the type of JsonValueReaderWriter<TValue> to use for elements of the collection.

(Inherited from IReadOnlyElementType)
GetJsonValueReaderWriterTypeConfigurationSource()

Returns the configuration source for GetJsonValueReaderWriter().

GetMaxLength()

Gets the maximum length of data that is allowed in elements of the collection. For example, if the element type is a String then this is the maximum number of characters.

(Inherited from IReadOnlyElementType)
GetMaxLengthConfigurationSource()

Returns the configuration source for GetMaxLength().

GetPrecision()

Gets the precision of data that is allowed in elements of the collection. For example, if the element type is a Decimal, then this is the maximum number of digits.

(Inherited from IReadOnlyElementType)
GetPrecisionConfigurationSource()

Returns the configuration source for GetPrecision().

GetProviderClrType()

Gets the type that the elements of the collection will be converted to before being sent to the database provider.

(Inherited from IReadOnlyElementType)
GetProviderClrTypeConfigurationSource()

Returns the configuration source for GetProviderClrType().

GetScale()

Gets the scale of data that is allowed in this elements of the collection. For example, if the element type is a Decimal, then this is the maximum number of decimal places.

(Inherited from IReadOnlyElementType)
GetScaleConfigurationSource()

Returns the configuration source for GetScale().

GetTypeMapping()

Returns the CoreTypeMapping for the elements of the collection from a finalized model.

(Inherited from IReadOnlyElementType)
GetTypeMappingConfigurationSource()

Gets the ConfigurationSource for CoreTypeMapping of the element.

GetValueComparer()

Gets the custom ValueComparer for elements of the collection.

(Inherited from IReadOnlyElementType)
GetValueComparerConfigurationSource()

Returns the configuration source for GetValueComparer().

GetValueConverter()

Gets the custom ValueConverter for this elements of the collection.

(Inherited from IReadOnlyElementType)
GetValueConverterConfigurationSource()

Returns the configuration source for GetValueConverter().

IsUnicode()

Gets a value indicating whether elements of the collection can persist Unicode characters.

(Inherited from IReadOnlyElementType)
RemoveAnnotation(String)

Removes the annotation with the given name from this object.

(Inherited from IConventionAnnotatable)
SetAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from IConventionAnnotatable)
SetIsNullable(Nullable<Boolean>, Boolean)

Sets a value indicating whether elements in the collection can be null.

SetIsUnicode(Nullable<Boolean>, Boolean)

Sets a value indicating whether elements of the collection can persist Unicode characters.

SetJsonValueReaderWriterType(Type, Boolean)

Sets the type of JsonValueReaderWriter<TValue> to use for elements of the collection.

SetMaxLength(Nullable<Int32>, Boolean)

Sets the maximum length of data that is allowed in elements of the collection. For example, if the element type is a String then this is the maximum number of characters.

SetOrRemoveAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

(Inherited from IConventionAnnotatable)
SetPrecision(Nullable<Int32>, Boolean)

Sets the precision of data that is allowed in elements of the collection. For example, if the element type is a Decimal, then this is the maximum number of digits.

SetProviderClrType(Type, Boolean)

Sets the type that the elements of the collection will be converted to before being sent to the database provider.

SetScale(Nullable<Int32>, Boolean)

Sets the scale of data that is allowed in this elements of the collection. For example, if the element type is a Decimal, then this is the maximum number of decimal places.

SetTypeMapping(CoreTypeMapping, Boolean)

Sets the CoreTypeMapping for the given element.

SetValueComparer(Type, Boolean)

Sets the custom ValueComparer for elements of the collection.

SetValueComparer(ValueComparer, Boolean)

Sets the custom ValueComparer for elements of the collection.

SetValueConverter(Type, Boolean)

Sets the custom ValueConverter for this elements of the collection.

SetValueConverter(ValueConverter, Boolean)

Sets the custom ValueConverter for this elements of the collection.

ToDebugString(MetadataDebugStringOptions, Int32)

Creates a human-readable representation of the given metadata.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

(Inherited from IReadOnlyElementType)

Extension Methods

FindRelationalTypeMapping(IReadOnlyElementType)

Returns the RelationalTypeMapping for the given element on a finalized model.

GetIsFixedLengthConfigurationSource(IConventionElementType)

Gets the ConfigurationSource for IsFixedLength(IReadOnlyElementType).

GetRelationalTypeMapping(IReadOnlyElementType)

Returns the RelationalTypeMapping for the given element on a finalized model.

GetStoreType(IReadOnlyElementType)

Returns the database type of the elements, or null if the database type could not be found.

GetStoreTypeConfigurationSource(IConventionElementType)

Gets the ConfigurationSource for the database type.

IsFixedLength(IReadOnlyElementType)

Returns a flag indicating whether the elements are capable of storing only fixed-length data, such as strings.

IsFixedLength(IReadOnlyElementType, StoreObjectIdentifier)

Returns a flag indicating whether the elements are capable of storing only fixed-length data, such as strings.

SetIsFixedLength(IConventionElementType, Nullable<Boolean>, Boolean)

Sets a flag indicating whether the elements are capable of storing only fixed-length data, such as strings.

SetStoreType(IConventionElementType, String, Boolean)

Sets the database type of the elements.

Applies to