Delen via


OwnershipBuilder Class

Definition

Provides a simple API for configuring an ownership.

public class OwnershipBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.RelationshipBuilderBase
type OwnershipBuilder = class
    inherit RelationshipBuilderBase
Public Class OwnershipBuilder
Inherits RelationshipBuilderBase
Inheritance
OwnershipBuilder
Derived

Remarks

See Modeling entity types and relationships for more information and examples.

Constructors

OwnershipBuilder(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(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(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 annotation already exists its value will be updated.

HasForeignKey(String[])

Configures the property(s) to use as the foreign key for this relationship.

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.

Applies to