Table of Contents

Method GetOrAddTopLevelDefinition

Namespace
MongoDB.EntityFrameworkCore.Metadata.Search.Definitions
Assembly
MongoDB.EntityFrameworkCore.dll

GetOrAddTopLevelDefinition<TDefinition>(string)

Finds the top-level definition for the given name and type. If none is found, then a new instance is created and returned.

public TDefinition GetOrAddTopLevelDefinition<TDefinition>(string elementName) where TDefinition : ISearchIndexDefinition, new()

Parameters

elementName string

The element to which the definition applies.

Returns

TDefinition

The existing definition, or a new one.

Type Parameters

TDefinition

The type of field definition to find or add.