Condividi tramite


ReferenceOwnershipBuilder<TEntity,TRelatedEntity>.HasIndex Metodo

Definizione

Configura un indice nelle proprietà specificate. Se è presente un indice esistente nel set specificato di proprietà, l'indice esistente verrà restituito per la configurazione.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder HasIndex (System.Linq.Expressions.Expression<Func<TRelatedEntity,object>> indexExpression);
override this.HasIndex : System.Linq.Expressions.Expression<Func<'RelatedEntity, obj>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder
Public Overridable Function HasIndex (indexExpression As Expression(Of Func(Of TRelatedEntity, Object))) As IndexBuilder

Parametri

indexExpression
Expression<Func<TRelatedEntity,Object>>

Espressione lambda che rappresenta le proprietà da includere nell'indice (blog => blog.Url).

Se l'indice è costituito da più proprietà, specificare un tipo anonimo, incluse le proprietà (post => new { post.Title, post.BlogId }).

Restituisce

Oggetto che può essere usato per configurare l'indice.

Si applica a