OwnershipBuilder<TEntity,TDependentEntity> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a simple API for configuring an ownership.
public class OwnershipBuilder<TEntity,TDependentEntity> : Microsoft.EntityFrameworkCore.Metadata.Builders.OwnershipBuilder where TEntity : class where TDependentEntity : class
type OwnershipBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> = class
inherit OwnershipBuilder
Public Class OwnershipBuilder(Of TEntity, TDependentEntity)
Inherits OwnershipBuilder
Type Parameters
- TEntity
- TDependentEntity
- Inheritance
Remarks
See Modeling entity types and relationships for more information and examples.
Constructors
OwnershipBuilder<TEntity,TDependentEntity>(IMutableEntityType, IMutableEntityType, IMutableForeignKey) |
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. |
OwnershipBuilder<TEntity,TDependentEntity>(InternalForeignKeyBuilder, OwnershipBuilder, Boolean, Boolean, Boolean) |
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. |
OwnershipBuilder<TEntity,TDependentEntity>(InternalRelationshipBuilder, OwnershipBuilder, Boolean, Boolean, Boolean) |
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release. |
Properties
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 RelationshipBuilderBase) |
DependentEntityType |
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 RelationshipBuilderBase) |
Metadata |
The foreign key that represents this relationship. (Inherited from RelationshipBuilderBase) |
PrincipalEntityType |
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 RelationshipBuilderBase) |
Methods
HasAnnotation(String, Object) |
Adds or updates an annotation on the foreign key. If an annotation with the key specified in
|
HasForeignKey(Expression<Func<TDependentEntity,Object>>) |
Configures the property(s) to use as the foreign key for this relationship. |
HasForeignKey(String[]) |
Configures the property(s) to use as the foreign key for this relationship. |
HasPrincipalKey(Expression<Func<TEntity,Object>>) |
Configures the unique property(s) that this relationship targets. Typically you would only call this method if you want to use a property(s) other than the primary key as the principal property(s). If the specified property(s) is not already a unique constraint (or the primary key) then a new unique constraint will be introduced. |
HasPrincipalKey(String[]) |
Configures the unique property(s) that this relationship targets. Typically you would only call this method if you want to use a property(s) other than the primary key as the principal property(s). If the specified property(s) is not already a unique constraint (or the primary key) then a new unique constraint will be introduced. |
Explicit Interface Implementations
IInfrastructure<IConventionForeignKeyBuilder>.Instance |
Gets the internal builder being used to configure this relationship. (Inherited from RelationshipBuilderBase) |
IInfrastructure<InternalRelationshipBuilder>.Instance |
Gets the internal builder being used to configure this relationship. (Inherited from RelationshipBuilderBase) |
Extension Methods
GetInfrastructure<T>(IInfrastructure<T>) |
Gets the value from a property that is being hidden using IInfrastructure<T>. This method is typically used by database providers (and other extensions). It is generally not used in application code. |
HasConstraintName(OwnershipBuilder, String) |
Configures the foreign key constraint name for this relationship when targeting a relational database. |
HasConstraintName<TEntity,TDependentEntity>(OwnershipBuilder<TEntity,TDependentEntity>, String) |
Configures the foreign key constraint name for this relationship when targeting a relational database. |
Applies to
Entity Framework