KeyBuilder KeyBuilder Class

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.

Syntax

Declaration

public class KeyBuilder : IInfrastructure<IMutableModel>, IInfrastructure<InternalKeyBuilder>Public Class KeyBuilder
    Implements IInfrastructure(Of IMutableModel), IInfrastructure(Of InternalKeyBuilder)

Inheritance Hierarchy

  • System.Object
    System.Object
  • KeyBuilder
    KeyBuilder

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

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 summary

The key being configured.

Methods summary

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.

Explicit Interface Implementations summary

The model that the key belongs to.

The internal builder being used to configure the key.

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

    Property Value

Methods

  • 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.

Explicit Interface Implementations

  • IInfrastructure<IMutableModel>.Instance
    Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.IMutableModel>.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<InternalKeyBuilder>.Instance
    Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalKeyBuilder>.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

Details

Assembly

Microsoft.EntityFrameworkCore.dll