Table of Contents

Class TlumachDisplayNameOptions

Namespace
Tlumach.AspNetCore.Mvc
Assembly
Tlumach.AspNetCore.Mvc.dll
public sealed class TlumachDisplayNameOptions
Inheritance
TlumachDisplayNameOptions
Inherited Members

Properties

ContainerKey

Gets or sets a function that returns the key of a container type; when set, KeyStyle and RootNamespace are not used.

public Func<Type, string>? ContainerKey { get; set; }

Property Value

Func<Type, string>

KeyPrefix

Gets or sets the text that starts every display-name key. The default is "DisplayNames.".

public string KeyPrefix { get; set; }

Property Value

string

KeyStyle

Gets or sets how the key of the container type is formed. The default is RelativeTypeName.

public TlumachDisplayNameKeyStyle KeyStyle { get; set; }

Property Value

TlumachDisplayNameKeyStyle

RootNamespace

Gets or sets the function that returns the root namespace of an assembly, which RelativeTypeName removes. The default is DefaultRootNamespace(Assembly); set it when a project sets its own RootNamespace. Returning null removes nothing.

public Func<Assembly, string?> RootNamespace { get; set; }

Property Value

Func<Assembly, string>

TranslationManager

Gets or sets the translation manager of the display names. When null, the manager of the default options of AddTlumachLocalization is used.

public TranslationManager? TranslationManager { get; set; }

Property Value

TranslationManager

Methods

DefaultRootNamespace(Assembly)

Returns the default root namespace of an assembly: its simple name with "-" replaced by "_", which is the default RootNamespace of an SDK project.

public static string? DefaultRootNamespace(Assembly assembly)

Parameters

assembly Assembly

The assembly of a model type.

Returns

string

The root namespace, or null if the assembly has no name.