QueryTypeBuilder<TQuery> Class

Definition

Caution

Use EntityTypeBuilder instead

Provides a simple API for configuring an IMutableEntityType.

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.

public class QueryTypeBuilder<TQuery> : Microsoft.EntityFrameworkCore.Metadata.Builders.QueryTypeBuilder where TQuery : class
[System.Obsolete("Use EntityTypeBuilder instead")]
public class QueryTypeBuilder<TQuery> : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TQuery> where TQuery : class
type QueryTypeBuilder<'Query (requires 'Query : null)> = class
    inherit QueryTypeBuilder
[<System.Obsolete("Use EntityTypeBuilder instead")>]
type QueryTypeBuilder<'Query (requires 'Query : null)> = class
    inherit EntityTypeBuilder<'Query (requires 'Query : null)>
Public Class QueryTypeBuilder(Of TQuery)
Inherits QueryTypeBuilder
Public Class QueryTypeBuilder(Of TQuery)
Inherits EntityTypeBuilder(Of TQuery)

Type Parameters

TQuery

The query type being configured.

Inheritance
QueryTypeBuilder<TQuery>
Inheritance
QueryTypeBuilder<TQuery>
Attributes

Constructors

QueryTypeBuilder<TQuery>(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.

QueryTypeBuilder<TQuery>(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 query type being configured.

(Inherited from QueryTypeBuilder)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
HasAnnotation(String, Object)

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

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.

(Inherited from EntityTypeBuilder<TEntity>)
HasBaseType(String)

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

HasBaseType(String)

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

(Inherited from EntityTypeBuilder<TEntity>)
HasBaseType(Type)

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

HasBaseType(Type)

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

(Inherited from EntityTypeBuilder<TEntity>)
HasBaseType<TBaseType>()

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

HasBaseType<TBaseType>()

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

(Inherited from EntityTypeBuilder<TEntity>)
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<TEntity>)
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<TEntity>)
HasData(IEnumerable<Object>)

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

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

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

(Inherited from EntityTypeBuilder<TEntity>)
HasData(Object[])

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

(Inherited from EntityTypeBuilder<TEntity>)
HasData(TEntity[])

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

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

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

(Inherited from EntityTypeBuilder<TEntity>)
HasKey(String[])

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
HasMany<TRelatedEntity>(String)

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
HasNoKey()

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

(Inherited from EntityTypeBuilder<TEntity>)
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 query type has a reference that points to a single instance of the other type in the relationship.

Note that calling this method with no parameters will explicitly configure this side of the relationship to use no navigation property, even if such a property exists on the entity type. If the navigation property is to be used, then it must be specified.

After calling this method, you should chain a call to WithMany(String) or WithOne(String) to fully configure the relationship. Calling just this method without the chained call will not produce a valid relationship.

(Inherited from QueryTypeBuilder)
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 query type has a reference that points to a single instance of the other type in the relationship.

After calling this method, you should chain a call to WithMany(String) or WithOne(String) to fully configure the relationship. Calling just this method without the chained call will not produce a valid relationship.

(Inherited from QueryTypeBuilder)
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.

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

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

Note that calling this method with no parameters will explicitly configure this side of the relationship to use no navigation property, even if such a property exists on the entity type. If the navigation property is to be used, then it must be specified.

After calling this method, you should chain a call to WithMany(Expression<Func<TRelatedEntity,IEnumerable<TEntity>>>) or WithOne(Expression<Func<TRelatedEntity,TEntity>>) to fully configure the relationship. Calling just this method without the chained call will not produce a valid 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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

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

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

HasQueryFilter(LambdaExpression)

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

(Inherited from QueryTypeBuilder)
HasQueryFilter(LambdaExpression)

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

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

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

Ignore(String)

Excludes the given property from the query type. This method is typically used to remove properties from the query 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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

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

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
OwnsMany<TRelatedEntity>(String)

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

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

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

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

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
OwnsMany<TRelatedEntity>(String, String)

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

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

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
OwnsOne<TRelatedEntity>(String)

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

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

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

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

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
OwnsOne<TRelatedEntity>(String, String)

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

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

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

(Inherited from EntityTypeBuilder<TEntity>)
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.

(Inherited from EntityTypeBuilder<TEntity>)
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 query type. If no property with the given name exists, then a new property will be added.

When adding a new property with this overload the property name must match the name of a CLR property or field on the query type. This overload cannot be used to add a new shadow state property.

(Inherited from QueryTypeBuilder)
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 query type. If no property with the given name exists, then a new property will be added.

When adding a new property, if a property with the same name exists in the query type class then it will be added to the model. If no property exists in the query type class, then a new shadow state property will be added. A shadow state property is one that does not have a corresponding property in the query type class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the query type class.

(Inherited from QueryTypeBuilder)
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.

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

Returns an object that can be used to configure a property of the query 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 query type. If no property with the given name exists, then a new property will be added.

When adding a new property, if a property with the same name exists in the query type class then it will be added to the model. If no property exists in the query type class, then a new shadow state property will be added. A shadow state property is one that does not have a corresponding property in the query type class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the query type class.

(Inherited from QueryTypeBuilder)
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.

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

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

UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for all properties of this query 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 will change that behavior for all properties of this query type as described in the PropertyAccessMode enum.

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

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<TEntity>)
UsePropertyAccessMode(PropertyAccessMode)

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

(Inherited from EntityTypeBuilder<TEntity>)

Explicit Interface Implementations

IInfrastructure<IMutableModel>.Instance

The model that the query type belongs to.

(Inherited from QueryTypeBuilder)
IInfrastructure<InternalEntityTypeBuilder>.Instance

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

(Inherited from QueryTypeBuilder)
IInfrastructure<InternalEntityTypeBuilder>.Instance

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

(Inherited from EntityTypeBuilder)

Extension Methods

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.

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.

HasCheckConstraint(EntityTypeBuilder, String, String)
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.

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

ToTable(EntityTypeBuilder, String)

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<TEntity>(EntityTypeBuilder<TEntity>, String)

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.

ToView(EntityTypeBuilder, String)

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<TEntity>(EntityTypeBuilder<TEntity>, String)

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.

HasDiscriminator(QueryTypeBuilder)

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

HasDiscriminator(QueryTypeBuilder, String, Type)

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

HasDiscriminator<TDiscriminator>(QueryTypeBuilder, String)

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

HasDiscriminator<TQuery,TDiscriminator>(QueryTypeBuilder<TQuery>, Expression<Func<TQuery,TDiscriminator>>)

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

ToView(QueryTypeBuilder, String)

Configures the view or table that the view maps to when targeting a relational database.

ToView(QueryTypeBuilder, String, String)

Configures the view or table that the view maps to when targeting a relational database.

ToView<TQuery>(QueryTypeBuilder<TQuery>, String)

Configures the view or table that the view maps to when targeting a relational database.

ToView<TQuery>(QueryTypeBuilder<TQuery>, String, String)

Configures the view or table that the view maps to when targeting a relational database.

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.

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