KeyBuilder KeyBuilder Class

Definition

Provides a simple API for configuring a Key.

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 KeyBuilder : IInfrastructure<IMutableModel>, IInfrastructure<InternalKeyBuilder>
Public Class KeyBuilder
    Implements IInfrastructure(Of IMutableModel), IInfrastructure(Of InternalKeyBuilder)
Inheritance
System.ObjectSystem.Object
KeyBuilderKeyBuilder
Implements

Constructors

KeyBuilder(InternalKeyBuilder) KeyBuilder(InternalKeyBuilder)

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.

public KeyBuilder(InternalKeyBuilder builder)
Public Sub New(builder As InternalKeyBuilder)
Parameters

Properties

Metadata Metadata

The key being configured.

public virtual IMutableKey Metadata { get; }
Public Overridable ReadOnly Property Metadata As IMutableKey

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

HasAnnotation(String, Object) HasAnnotation(String, Object)

Adds or updates an annotation on the key. If an annotation with the key specified in annotation already exists it's value will be updated.

public virtual KeyBuilder HasAnnotation(string annotation, object value)
Public Overridable Function HasAnnotation(annotation As String, value As Object) As KeyBuilder
Parameters
annotation
System.String System.String

The key of the annotation to be added or updated.

value
System.Object System.Object

The value to be stored in the annotation.

Returns

The same builder instance so that multiple configuration calls can be chained.

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object

Explicit Interface Implementations

IInfrastructure.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.Instance

The model that the key belongs to.

IMutableModel IInfrastructure<IMutableModel>.Instance { get; }
ReadOnly WriteOnly Property Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.IMutableModel>.Instance As IMutableModel Implements IInfrastructure(Of IMutableModel).Instance
Returns

IInfrastructure.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.Instance

The internal builder being used to configure the key.

InternalKeyBuilder IInfrastructure<InternalKeyBuilder>.Instance { get; }
ReadOnly WriteOnly Property Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalKeyBuilder>.Instance As InternalKeyBuilder Implements IInfrastructure(Of InternalKeyBuilder).Instance
Returns