IndexBuilder IndexBuilder Class

Definition

Provides a simple API for configuring an Index.

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 IndexBuilder : IInfrastructure<IMutableModel>, IInfrastructure<InternalIndexBuilder>
Public Class IndexBuilder
    Implements IInfrastructure(Of IMutableModel), IInfrastructure(Of InternalIndexBuilder)
Inheritance
System.ObjectSystem.Object
IndexBuilderIndexBuilder
Implements

Inherited Members

System.Object

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

Constructors

IndexBuilder(InternalIndexBuilder) IndexBuilder(InternalIndexBuilder)

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 IndexBuilder(InternalIndexBuilder builder)
Public Sub New(builder As InternalIndexBuilder)
Parameters

Properties

Metadata Metadata

The index being configured.

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

Methods

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

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

public virtual IndexBuilder HasAnnotation(string annotation, object value)
Public Overridable Function HasAnnotation(annotation As String, value As Object) As IndexBuilder
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.

IsUnique(Boolean) IsUnique(Boolean)

Configures whether this index is unique (i.e. the value(s) for each instance must be unique).

public virtual IndexBuilder IsUnique(bool unique = true)
Public Overridable Function IsUnique(unique As Boolean = True) As IndexBuilder
Parameters
unique
System.Boolean System.Boolean

A value indicating whether this index is unique.

Returns

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

Explicit Interface Implementations

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

The model that the index 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 index.

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