ElementTypeBuilder Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a simple API for configuring the IMutableElementType of a primitive collection.
public class ElementTypeBuilder : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder>
type ElementTypeBuilder = class
interface IInfrastructure<IConventionElementTypeBuilder>
Public Class ElementTypeBuilder
Implements IInfrastructure(Of IConventionElementTypeBuilder)
- Inheritance
-
ElementTypeBuilder
- Implements
Remarks
Instances of this class are returned from methods when using the ModelBuilder API and it is not designed to be directly constructed in your application code.
See Modeling entity types and relationships for more information and examples.
Constructors
ElementTypeBuilder(IMutableElementType) |
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release. |
Properties
Metadata |
The element type being configured. |
Methods
HasAnnotation(String, Object) |
Adds or updates an annotation on the element type. If an annotation with the key specified in
|
HasConversion(Type) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion(Type, Type) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion(Type, ValueComparer) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion(ValueConverter) |
Configures elements of the collection so that their values are converted to and from the database using the given ValueConverter. |
HasConversion(ValueConverter, ValueComparer) |
Configures elements of the collection so that their values are converted before using the given ValueConverter. |
HasConversion<TConversion,TComparer>() |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion<TConversion>() |
Configures elements of the collection so their values are converted before writing to the database and converted back when reading from the database. |
HasConversion<TConversion>(ValueComparer) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasMaxLength(Int32) |
Configures the maximum length of data that can be stored in elements of the collection. |
HasPrecision(Int32) |
Configures the precision of elements of the collection. |
HasPrecision(Int32, Int32) |
Configures the precision and scale of elements of the collection. |
IsRequired(Boolean) |
Configures whether elements of the collection must have a value or can be |
IsUnicode(Boolean) |
Configures whether elements of the collection are capable of persisting unicode characters. |
Explicit Interface Implementations
IInfrastructure<IConventionElementTypeBuilder>.Instance |
The internal builder being used to configure the element type. |
Extension Methods
GetInfrastructure<T>(IInfrastructure<T>) |
Gets the value from a property that is being hidden using IInfrastructure<T>. This method is typically used by database providers (and other extensions). It is generally not used in application code. |
HasStoreType(ElementTypeBuilder, String) |
Configures the data type of the elements of the collection. |
IsFixedLength(ElementTypeBuilder, Boolean) |
Configures the elements as capable of storing only fixed-length data, such as strings. |
Applies to
Entity Framework