Table of Contents

Method GetOrAddFieldDefinition

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

GetOrAddFieldDefinition<TDefinition>(IMutablePropertyBase)

Finds the definition for the field mapped to a given property of the given type. If none is found, then a new instance is created and returned.

public TDefinition GetOrAddFieldDefinition<TDefinition>(IMutablePropertyBase member) where TDefinition : ISearchIndexDefinition, new()

Parameters

member IMutablePropertyBase

The member 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.

GetOrAddFieldDefinition<TDefinition>(string)

Finds the definition for the field with the given name If none is found, then a new instance is created and returned.

public TDefinition GetOrAddFieldDefinition<TDefinition>(string fieldName) where TDefinition : ISearchIndexDefinition, new()

Parameters

fieldName string

The name of the field 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.