EntityTypeBuilder<TEntity> Class

Definition

Provides a simple API for configuring an IMutableEntityType.

public class EntityTypeBuilder<TEntity> : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder where TEntity : class
type EntityTypeBuilder<'Entity (requires 'Entity : null)> = class
    inherit EntityTypeBuilder
Public Class EntityTypeBuilder(Of TEntity)
Inherits EntityTypeBuilder

Type Parameters

TEntity

The entity type being configured.

Inheritance
EntityTypeBuilder<TEntity>
Derived

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.

Constructors

EntityTypeBuilder<TEntity>(IMutableEntityType)

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.

EntityTypeBuilder<TEntity>(InternalEntityTypeBuilder)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

Properties

Builder

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.

(Inherited from EntityTypeBuilder)
Metadata

The entity type being configured.

(Inherited from EntityTypeBuilder)

Methods

ComplexProperty(String)

Returns an object that can be used to configure a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty(String, Action<ComplexPropertyBuilder>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

ComplexProperty(String, Action<ComplexPropertyBuilder>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty(Type, String)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty(Type, String, String)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>)

Returns an object that can be used to configure a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String)

Returns an object that can be used to configure a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty<TProperty>(String)

Returns an object that can be used to configure a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty<TProperty>(String, String)

Returns an object that can be used to configure a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
FindRelatedEntityType(String, String)

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.

(Inherited from EntityTypeBuilder)
FindRelatedEntityType(Type, String)

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.

(Inherited from EntityTypeBuilder)
HasAlternateKey(Expression<Func<TEntity,Object>>)

Creates an alternate key in the model for this entity type if one does not already exist over the specified properties. This will force the properties to be read-only. Use HasIndex(String[]) or HasIndex(Expression<Func<TEntity,Object>>) to specify uniqueness in the model that does not force properties to be read-only.

HasAlternateKey(String[])

Creates an alternate key in the model for this entity type if one does not already exist over the specified properties. This will force the properties to be read-only. Use HasIndex(String[]) or HasIndex(Expression<Func<TEntity,Object>>) to specify uniqueness in the model that does not force properties to be read-only.

HasAlternateKey(String[])

Creates an alternate key in the model for this entity type if one does not already exist over the specified properties. This will force the properties to be read-only. Use HasIndex to specify uniqueness in the model that does not force properties to be read-only.

(Inherited from EntityTypeBuilder)
HasAnnotation(String, Object)

Adds or updates an annotation on the entity type. If an annotation with the key specified in annotation already exists its value will be updated.

HasBaseType(String)

Sets the base type of this entity type in an inheritance hierarchy.

HasBaseType(Type)

Sets the base type of this entity type in an inheritance hierarchy.

HasBaseType<TBaseType>()

Sets the base type of this entity type in an inheritance hierarchy.

HasChangeTrackingStrategy(ChangeTrackingStrategy)

Configures the ChangeTrackingStrategy to be used for this entity type. This strategy indicates how the context detects changes to properties for an instance of the entity type.

HasChangeTrackingStrategy(ChangeTrackingStrategy)

Configures the ChangeTrackingStrategy to be used for this entity type. This strategy indicates how the context detects changes to properties for an instance of the entity type.

HasChangeTrackingStrategy(ChangeTrackingStrategy)

Configures the ChangeTrackingStrategy to be used for this entity type. This strategy indicates how the context detects changes to properties for an instance of the entity type.

(Inherited from EntityTypeBuilder)
HasChangeTrackingStrategy(ChangeTrackingStrategy)

Configures the ChangeTrackingStrategy to be used for this entity type. This strategy indicates how the context detects changes to properties for an instance of the entity type.

(Inherited from EntityTypeBuilder)
HasData(IEnumerable<Object>)

Adds seed data to this entity type. It is used to generate data motion migrations.

HasData(IEnumerable<Object>)

Configures this entity to have seed data. It is used to generate data motion migrations.

(Inherited from EntityTypeBuilder)
HasData(IEnumerable<TEntity>)

Adds seed data to this entity type. It is used to generate data motion migrations.

HasData(Object[])

Adds seed data to this entity type. It is used to generate data motion migrations.

HasData(Object[])

Configures this entity to have seed data. It is used to generate data motion migrations.

(Inherited from EntityTypeBuilder)
HasData(TEntity[])

Adds seed data to this entity type. It is used to generate data motion migrations.

HasDiscriminator()

Configures the discriminator property used to identify the entity type in the store.

(Inherited from EntityTypeBuilder)
HasDiscriminator(String, Type)

Configures the discriminator property used to identify the entity type in the store.

(Inherited from EntityTypeBuilder)
HasDiscriminator<TDiscriminator>(Expression<Func<TEntity,TDiscriminator>>)

Configures the discriminator property used to identify the entity type in the store.

HasDiscriminator<TDiscriminator>(String)

Configures the discriminator property used to identify the entity type in the store.

(Inherited from EntityTypeBuilder)
HasIndex(Expression<Func<TEntity,Object>>)

Configures an unnamed index on the specified properties. If there is an existing index on the given list of properties, then the existing index will be returned for configuration.

HasIndex(Expression<Func<TEntity,Object>>, String)

Configures an index on the specified properties with the given name. If there is an existing index on the given list of properties and with the given name, then the existing index will be returned for configuration.

HasIndex(String[])

Configures an unnamed index on the specified properties. If there is an existing index on the given list of properties, then the existing index will be returned for configuration.

HasIndex(String[])

Configures an unnamed index on the specified properties. If there is an existing unnamed index on the given list of properties, then the existing index will be returned for configuration.

(Inherited from EntityTypeBuilder)
HasIndex(String[], String)

Configures an index on the specified properties with the given name. If there is an existing index on the given list of properties and with the given name, then the existing index will be returned for configuration.

HasIndex(String[], String)

Configures an index on the specified properties and with the given name. If there is an existing index on the given list of properties and with the given name, then the existing index will be returned for configuration.

(Inherited from EntityTypeBuilder)
HasKey(Expression<Func<TEntity,Object>>)

Sets the properties that make up the primary key for this entity type.

HasKey(String[])

Sets the properties that make up the primary key for this entity type.

HasKey(String[])

Sets the properties that make up the primary key for this entity type.

(Inherited from EntityTypeBuilder)
HasMany(String)

Configures a relationship where this entity type has a collection that contains instances of the other type in the relationship.

(Inherited from EntityTypeBuilder)
HasMany(String, String)

Configures a relationship where this entity type has a collection that contains instances of the other type in the relationship.

(Inherited from EntityTypeBuilder)
HasMany(Type, String)

Configures a relationship where this entity type has a collection that contains instances of the other type in the relationship.

(Inherited from EntityTypeBuilder)
HasMany<TRelatedEntity>(Expression<Func<TEntity,IEnumerable<TRelatedEntity>>>)

Configures a relationship where this entity type has a collection that contains instances of the other type in the relationship.

HasMany<TRelatedEntity>(String)

Configures a relationship where this entity type has a collection that contains instances of the other type in the relationship.

HasManyBuilder(EntityType, PropertyInfo)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from EntityTypeBuilder)
HasManyBuilder(EntityType, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from EntityTypeBuilder)
HasNoDiscriminator()

Configures the entity type as having no discriminator property.

HasNoDiscriminator()

Configures the entity type as having no discriminator property.

(Inherited from EntityTypeBuilder)
HasNoKey()

Configures the entity type to have no keys. It will only be usable for queries.

HasNoKey()

Configures the entity type to have no keys. It will only be usable for queries.

(Inherited from EntityTypeBuilder)
HasOne(String)

Configures a relationship where this entity type has a reference that points to a single instance of the other type in the relationship.

(Inherited from EntityTypeBuilder)
HasOne(String, String)

Configures a relationship where this entity type has a reference that points to a single instance of the other type in the relationship.

(Inherited from EntityTypeBuilder)
HasOne(Type, String)

Configures a relationship where this entity type has a reference that points to a single instance of the other type in the relationship.

(Inherited from EntityTypeBuilder)
HasOne<TRelatedEntity>(Expression<Func<TEntity,TRelatedEntity>>)

Configures a relationship where this entity type has a reference that points to a single instance of the other type in the relationship.

HasOne<TRelatedEntity>(String)

Configures a relationship where this entity type has a reference that points to a single instance of the other type in the relationship.

HasOneBuilder(EntityType, PropertyInfo)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from EntityTypeBuilder)
HasOneBuilder(EntityType, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from EntityTypeBuilder)
HasOneBuilder(MemberIdentity, EntityType)

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.

(Inherited from EntityTypeBuilder)
HasQueryFilter(Expression<Func<TEntity,Boolean>>)

Specifies a LINQ predicate expression that will automatically be applied to any queries targeting this entity type.

HasQueryFilter(LambdaExpression)

Specifies a LINQ predicate expression that will automatically be applied to any queries targeting this entity type.

HasQueryFilter(LambdaExpression)

Specifies a LINQ predicate expression that will automatically be applied to any queries targeting this entity type.

(Inherited from EntityTypeBuilder)
Ignore(Expression<Func<TEntity,Object>>)

Excludes the given property from the entity type. This method is typically used to remove properties or navigations from the entity type that were added by convention.

Ignore(String)

Excludes the given property from the entity type. This method is typically used to remove properties or navigations from the entity type that were added by convention.

IndexerProperty(Type, String)

Returns an object that can be used to configure a property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
IndexerProperty<TProperty>(String)

Returns an object that can be used to configure a property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
Navigation(String)

Returns an object that can be used to configure an existing navigation property of the entity type. It is an error for the navigation property not to exist.

(Inherited from EntityTypeBuilder)
Navigation<TNavigation>(Expression<Func<TEntity,IEnumerable<TNavigation>>>)

Returns an object that can be used to configure an existing navigation property of the entity type. It is an error for the navigation property not to exist.

Navigation<TNavigation>(Expression<Func<TEntity,TNavigation>>)

Returns an object that can be used to configure an existing navigation property of the entity type. It is an error for the navigation property not to exist.

New(InternalEntityTypeBuilder)

Creates a new builder based on the provided internal builder. This overridden implementation creates EntityTypeBuilder<TEntity> instances so that logic inherited from the base class will use those instead of EntityTypeBuilder.

New(InternalEntityTypeBuilder)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from EntityTypeBuilder)
OwnsMany(String, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsMany(String, String, Action<CollectionOwnershipBuilder>)

Configures a relationship where this entity type provides identity to the other type in the relationship.

(Inherited from EntityTypeBuilder)
OwnsMany(String, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany(String, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsMany(String, Type, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsMany(String, Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany(String, Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsMany(Type, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsMany(Type, String, Action<CollectionOwnershipBuilder>)

Configures a relationship where this entity type provides identity to the other type in the relationship.

(Inherited from EntityTypeBuilder)
OwnsMany(Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany(Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsMany<TRelatedEntity>(Expression<Func<TEntity,IEnumerable<TRelatedEntity>>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany<TRelatedEntity>(Expression<Func<TEntity,IEnumerable<TRelatedEntity>>>, Action<CollectionOwnershipBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsMany<TRelatedEntity>(Expression<Func<TEntity,IEnumerable<TRelatedEntity>>>, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany<TRelatedEntity>(String)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany<TRelatedEntity>(String, Action<CollectionOwnershipBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsMany<TRelatedEntity>(String, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany<TRelatedEntity>(String, Expression<Func<TEntity,IEnumerable<TRelatedEntity>>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany<TRelatedEntity>(String, Expression<Func<TEntity,IEnumerable<TRelatedEntity>>>, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany<TRelatedEntity>(String, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsMany<TRelatedEntity>(String, String, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne(String, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsOne(String, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne(String, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsOne(String, String, Action<ReferenceOwnershipBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

(Inherited from EntityTypeBuilder)
OwnsOne(String, Type, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsOne(String, Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne(String, Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsOne(Type, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsOne(Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne(Type, String, Action<OwnedNavigationBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

(Inherited from EntityTypeBuilder)
OwnsOne(Type, String, Action<ReferenceOwnershipBuilder>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

(Inherited from EntityTypeBuilder)
OwnsOne<TRelatedEntity>(Expression<Func<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne<TRelatedEntity>(Expression<Func<TEntity,TRelatedEntity>>, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne<TRelatedEntity>(Expression<Func<TEntity,TRelatedEntity>>, Action<ReferenceOwnershipBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsOne<TRelatedEntity>(String)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne<TRelatedEntity>(String, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne<TRelatedEntity>(String, Action<ReferenceOwnershipBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.

Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.

OwnsOne<TRelatedEntity>(String, Expression<Func<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne<TRelatedEntity>(String, Expression<Func<TEntity,TRelatedEntity>>, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne<TRelatedEntity>(String, String)

Configures a relationship where the target entity is owned by (or part of) this entity.

OwnsOne<TRelatedEntity>(String, String, Action<OwnedNavigationBuilder<TEntity,TRelatedEntity>>)

Configures a relationship where the target entity is owned by (or part of) this entity.

PrimitiveCollection(String)

Returns an object that can be used to configure a property of the entity type where that property represents a collection of primitive values, such as strings or integers. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
PrimitiveCollection(Type, String)

Returns an object that can be used to configure a property of the entity type where that property represents a collection of primitive values, such as strings or integers. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
PrimitiveCollection<TProperty>(Expression<Func<TEntity,TProperty>>)

Returns an object that can be used to configure a property of the entity type where that property represents a collection of primitive values, such as strings or integers.

PrimitiveCollection<TProperty>(String)

Returns an object that can be used to configure a property of the entity type where that property represents a collection of primitive values, such as strings or integers. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
Property(String)

Returns an object that can be used to configure a property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
Property(Type, String)

Returns an object that can be used to configure a property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
Property<TProperty>(Expression<Func<TEntity,TProperty>>)

Returns an object that can be used to configure a property of the entity type. If the specified property is not already part of the model, it will be added.

Property<TProperty>(String)

Returns an object that can be used to configure a property of the entity type. If no property with the given name exists, then a new property will be added.

(Inherited from EntityTypeBuilder)
ToQuery(Expression<Func<IQueryable<TEntity>>>)
Obsolete.

Configures a query used to provide data for a keyless entity type.

UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for all properties of this entity type.

By default, the backing field, if one is found by convention or has been specified, is used when new objects are constructed, typically when entities are queried from the database. Properties are used for all other accesses. Calling this method witll change that behavior for all properties of this entity type as described in the PropertyAccessMode enum.

Calling this method overrrides for all properties of this entity type any access mode that was set on the model.

UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for all properties of this entity type.

UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for all properties of this entity type.

By default, the backing field, if one is found by convention or has been specified, is used when new objects are constructed, typically when entities are queried from the database. Properties are used for all other accesses. Calling this method witll change that behavior for all properties of this entity type as described in the PropertyAccessMode enum.

Calling this method overrrides for all properties of this entity type any access mode that was set on the model.

(Inherited from EntityTypeBuilder)
UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for all properties of this entity type.

(Inherited from EntityTypeBuilder)

Explicit Interface Implementations

IInfrastructure<IConventionEntityTypeBuilder>.Instance

Gets the internal builder being used to configure the entity type.

(Inherited from EntityTypeBuilder)
IInfrastructure<IMutableModel>.Instance

The model that the entity type belongs to.

(Inherited from EntityTypeBuilder)
IInfrastructure<InternalEntityTypeBuilder>.Instance

Gets the internal builder being used to configure the entity type.

(Inherited from EntityTypeBuilder)

Extension Methods

HasAnalyticalStoreTimeToLive(EntityTypeBuilder, Nullable<Int32>)

Configures the time to live for analytical store in seconds at container scope.

HasAnalyticalStoreTimeToLive<TEntity>(EntityTypeBuilder<TEntity>, Nullable<Int32>)

Configures the time to live for analytical store in seconds at container scope.

HasAutoscaleThroughput(EntityTypeBuilder, Nullable<Int32>)

Configures the autoscale provisioned throughput offering.

HasAutoscaleThroughput<TEntity>(EntityTypeBuilder<TEntity>, Nullable<Int32>)

Configures the autoscale provisioned throughput offering.

HasDefaultTimeToLive(EntityTypeBuilder, Nullable<Int32>)

Configures the default time to live in seconds at container scope.

HasDefaultTimeToLive<TEntity>(EntityTypeBuilder<TEntity>, Nullable<Int32>)

Configures the default time to live in seconds at container scope.

HasManualThroughput(EntityTypeBuilder, Nullable<Int32>)

Configures the manual provisioned throughput offering.

HasManualThroughput<TEntity>(EntityTypeBuilder<TEntity>, Nullable<Int32>)

Configures the manual provisioned throughput offering.

HasPartitionKey(EntityTypeBuilder, String)

Configures the property that is used to store the partition key.

HasPartitionKey<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures the property that is used to store the partition key.

HasPartitionKey<TEntity,TProperty>(EntityTypeBuilder<TEntity>, Expression<Func<TEntity,TProperty>>)

Configures the property that is used to store the partition key.

ToContainer(EntityTypeBuilder, String)

Configures the container that the entity type maps to when targeting Azure Cosmos.

ToContainer<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures the container that the entity type maps to when targeting Azure Cosmos.

UseETagConcurrency(EntityTypeBuilder)

Configures this entity to use CosmosDb etag concurrency checks.

UseETagConcurrency<TEntity>(EntityTypeBuilder<TEntity>)

Configures this entity to use CosmosDb etag concurrency checks.

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.

ToInMemoryQuery(EntityTypeBuilder, LambdaExpression)

Configures a query used to provide data for an entity type.

ToInMemoryQuery<TEntity>(EntityTypeBuilder<TEntity>, Expression<Func<IQueryable<TEntity>>>)

Configures a query used to provide data for an entity type.

DeleteUsingStoredProcedure(EntityTypeBuilder, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for deletes when targeting a relational database.

DeleteUsingStoredProcedure(EntityTypeBuilder, String, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for deletes when targeting a relational database.

DeleteUsingStoredProcedure(EntityTypeBuilder, String, String, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for deletes when targeting a relational database.

DeleteUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for deletes when targeting a relational database.

DeleteUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, String, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for deletes when targeting a relational database.

DeleteUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for deletes when targeting a relational database.

HasCheckConstraint(EntityTypeBuilder, String, String)
Obsolete.

Configures a database check constraint when targeting a relational database.

HasCheckConstraint(EntityTypeBuilder, String, String, Action<CheckConstraintBuilder>)
Obsolete.

Configures a database check constraint when targeting a relational database.

HasCheckConstraint<TEntity>(EntityTypeBuilder<TEntity>, String, String)
Obsolete.

Configures a database check constraint when targeting a relational database.

HasCheckConstraint<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<CheckConstraintBuilder>)
Obsolete.

Configures a database check constraint when targeting a relational database.

HasComment(EntityTypeBuilder, String)
Obsolete.

Configures a comment to be applied to the table

HasComment<TEntity>(EntityTypeBuilder<TEntity>, String)
Obsolete.

Configures a comment to be applied to the table

HasDiscriminator(EntityTypeBuilder)

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

HasDiscriminator(EntityTypeBuilder, String, Type)

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

HasDiscriminator<TDiscriminator>(EntityTypeBuilder, String)

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

HasDiscriminator<TEntity,TDiscriminator>(EntityTypeBuilder<TEntity>, Expression<Func<TEntity,TDiscriminator>>)

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

InsertUsingStoredProcedure(EntityTypeBuilder, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for inserts when targeting a relational database.

InsertUsingStoredProcedure(EntityTypeBuilder, String, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for inserts when targeting a relational database.

InsertUsingStoredProcedure(EntityTypeBuilder, String, String, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for inserts when targeting a relational database.

InsertUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for inserts when targeting a relational database.

InsertUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, String, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for inserts when targeting a relational database.

InsertUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for inserts when targeting a relational database.

SplitToTable(EntityTypeBuilder, String, Action<SplitTableBuilder>)

Configures some of the properties on this entity type to be mapped to a different table. The primary key properties are mapped to all tables, other properties must be explicitly mapped.

SplitToTable(EntityTypeBuilder, String, String, Action<SplitTableBuilder>)

Configures some of the properties on this entity type to be mapped to a different table. The primary key properties are mapped to all tables, other properties must be explicitly mapped.

SplitToTable<TEntity>(EntityTypeBuilder<TEntity>, String, Action<SplitTableBuilder<TEntity>>)

Configures some of the properties on this entity type to be mapped to a different table. The primary key properties are mapped to all tables, other properties must be explicitly mapped.

SplitToTable<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<SplitTableBuilder<TEntity>>)

Configures some of the properties on this entity type to be mapped to a different table. The primary key properties are mapped to all tables, other properties must be explicitly mapped.

SplitToView(EntityTypeBuilder, String, Action<SplitViewBuilder>)

Configures some of the properties on this entity type to be mapped to a different view. The primary key properties are mapped to all views, other properties must be explicitly mapped.

SplitToView(EntityTypeBuilder, String, String, Action<SplitViewBuilder>)

Configures some of the properties on this entity type to be mapped to a different view. The primary key properties are mapped to all views, other properties must be explicitly mapped.

SplitToView<TEntity>(EntityTypeBuilder<TEntity>, String, Action<SplitViewBuilder<TEntity>>)

Configures some of the properties on this entity type to be mapped to a different view. The primary key properties are mapped to all views, other properties must be explicitly mapped.

SplitToView<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<SplitViewBuilder<TEntity>>)

Configures some of the properties on this entity type to be mapped to a different view. The primary key properties are mapped to all views, other properties must be explicitly mapped.

ToFunction(EntityTypeBuilder, MethodInfo)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction(EntityTypeBuilder, MethodInfo, Action<TableValuedFunctionBuilder>)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction(EntityTypeBuilder, String)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction(EntityTypeBuilder, String, Action<TableValuedFunctionBuilder>)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction<TEntity>(EntityTypeBuilder<TEntity>, MethodInfo)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction<TEntity>(EntityTypeBuilder<TEntity>, MethodInfo, Action<TableValuedFunctionBuilder<TEntity>>)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction<TEntity>(EntityTypeBuilder<TEntity>, MethodInfo, Action<TableValuedFunctionBuilder>)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction<TEntity>(EntityTypeBuilder<TEntity>, String, Action<TableValuedFunctionBuilder<TEntity>>)

Configures the function that the entity type maps to when targeting a relational database.

ToFunction<TEntity>(EntityTypeBuilder<TEntity>, String, Action<TableValuedFunctionBuilder>)

Configures the function that the entity type maps to when targeting a relational database.

ToSqlQuery(EntityTypeBuilder, String)

Configures a SQL string used to provide data for the entity type.

ToSqlQuery<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures a SQL string used to provide data for the entity type.

ToTable(EntityTypeBuilder, Action<TableBuilder>)

Configures the table that the entity type maps to when targeting a relational database.

ToTable(EntityTypeBuilder, String)

Configures the table that the entity type maps to when targeting a relational database.

ToTable(EntityTypeBuilder, String, Action<TableBuilder>)

Configures the table that the entity type maps to when targeting a relational database.

ToTable(EntityTypeBuilder, String, String)

Configures the table that the entity type maps to when targeting a relational database.

ToTable(EntityTypeBuilder, String, String, Action<TableBuilder>)

Configures the table that the entity type maps to when targeting a relational database.

ToTable<TEntity>(EntityTypeBuilder<TEntity>, Action<TableBuilder<TEntity>>)

Configures the table that the entity type maps to when targeting a relational database.

ToTable<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures the table that the entity type maps to when targeting a relational database.

ToTable<TEntity>(EntityTypeBuilder<TEntity>, String, Action<TableBuilder<TEntity>>)

Configures the table that the entity type maps to when targeting a relational database.

ToTable<TEntity>(EntityTypeBuilder<TEntity>, String, Action<TableBuilder>)

Configures the table that the entity type maps to when targeting a relational database.

ToTable<TEntity>(EntityTypeBuilder<TEntity>, String, String)

Configures the table that the entity type maps to when targeting a relational database.

ToTable<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<TableBuilder<TEntity>>)

Configures the table that the entity type maps to when targeting a relational database.

ToTable<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<TableBuilder>)

Configures the table that the entity type maps to when targeting a relational database.

ToView(EntityTypeBuilder, String)

Configures the view that the entity type maps to when targeting a relational database.

ToView(EntityTypeBuilder, String, Action<ViewBuilder>)

Configures the view that the entity type maps to when targeting a relational database.

ToView(EntityTypeBuilder, String, String)

Configures the view that the entity type maps to when targeting a relational database.

ToView(EntityTypeBuilder, String, String, Action<ViewBuilder>)

Configures the view that the entity type maps to when targeting a relational database.

ToView<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures the view that the entity type maps to when targeting a relational database.

ToView<TEntity>(EntityTypeBuilder<TEntity>, String, Action<ViewBuilder<TEntity>>)

Configures the view that the entity type maps to when targeting a relational database.

ToView<TEntity>(EntityTypeBuilder<TEntity>, String, String)

Configures the view that the entity type maps to when targeting a relational database.

ToView<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<ViewBuilder<TEntity>>)

Configures the view that the entity type maps to when targeting a relational database.

UpdateUsingStoredProcedure(EntityTypeBuilder, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for updates when targeting a relational database.

UpdateUsingStoredProcedure(EntityTypeBuilder, String, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for updates when targeting a relational database.

UpdateUsingStoredProcedure(EntityTypeBuilder, String, String, Action<StoredProcedureBuilder>)

Configures the stored procedure that the entity type uses for updates when targeting a relational database.

UpdateUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for updates when targeting a relational database.

UpdateUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, String, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for updates when targeting a relational database.

UpdateUsingStoredProcedure<TEntity>(EntityTypeBuilder<TEntity>, String, String, Action<StoredProcedureBuilder<TEntity>>)

Configures the stored procedure that the entity type uses for updates when targeting a relational database.

UseTpcMappingStrategy(EntityTypeBuilder)

Configures TPC as the mapping strategy for the derived types. Each type will be mapped to a different database object. All properties will be mapped to columns on the corresponding object.

UseTpcMappingStrategy<TEntity>(EntityTypeBuilder<TEntity>)

Configures TPC as the mapping strategy for the derived types. Each type will be mapped to a different database object. All properties will be mapped to columns on the corresponding object.

UseTphMappingStrategy(EntityTypeBuilder)

Configures TPH as the mapping strategy for the derived types. All types will be mapped to the same database object. This is the default mapping strategy.

UseTphMappingStrategy<TEntity>(EntityTypeBuilder<TEntity>)

Configures TPH as the mapping strategy for the derived types. All types will be mapped to the same database object. This is the default mapping strategy.

UseTptMappingStrategy(EntityTypeBuilder)

Configures TPT as the mapping strategy for the derived types. Each type will be mapped to a different database object. Only the declared properties will be mapped to columns on the corresponding object.

UseTptMappingStrategy<TEntity>(EntityTypeBuilder<TEntity>)

Configures TPT as the mapping strategy for the derived types. Each type will be mapped to a different database object. Only the declared properties will be mapped to columns on the corresponding object.

ForSqliteToTable(EntityTypeBuilder, String)

Configures the table that the entity maps to when targeting SQLite.

ForSqliteToTable<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures the table that the entity maps to when targeting SQLite.

ForSqlServerHasIndex<TEntity>(EntityTypeBuilder<TEntity>, Expression<Func<TEntity,Object>>)

Configures an index on the specified properties. If there is an existing index on the given set of properties, then the existing index will be returned for configuration.

ForSqlServerIsMemoryOptimized(EntityTypeBuilder, Boolean)
Obsolete.

Configures the table that the entity maps to when targeting SQL Server as memory-optimized.

ForSqlServerIsMemoryOptimized<TEntity>(EntityTypeBuilder<TEntity>, Boolean)
Obsolete.

Configures the table that the entity maps to when targeting SQL Server as memory-optimized.

ForSqlServerToTable(EntityTypeBuilder, String)

Configures the table that the entity maps to when targeting SQL Server.

ForSqlServerToTable(EntityTypeBuilder, String, String)

Configures the table that the entity maps to when targeting SQL Server.

ForSqlServerToTable<TEntity>(EntityTypeBuilder<TEntity>, String)

Configures the table that the entity maps to when targeting SQL Server.

ForSqlServerToTable<TEntity>(EntityTypeBuilder<TEntity>, String, String)

Configures the table that the entity maps to when targeting SQL Server.

IsMemoryOptimized(EntityTypeBuilder, Boolean)
Obsolete.

Configures the table that the entity maps to when targeting SQL Server as memory-optimized.

IsMemoryOptimized<TEntity>(EntityTypeBuilder<TEntity>, Boolean)
Obsolete.

Configures the table that the entity maps to when targeting SQL Server as memory-optimized.

Applies to