Table of Contents

Interface INamingConvention

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Translates a CLR type/property name into a physical table/column name when the name was not declared explicitly (no [SqlTable]/[Column] attribute and no fluent mapping). Explicit names are always taken verbatim, so a convention never overrides a declared mapping.

public interface INamingConvention
Extension Methods

Remarks

Set the default convention on the context with UseNamingConvention(INamingConvention?); a single command can override it with WithNamingConvention. When no convention is configured, names are emitted as-is.

Implementations are expected to be stateless and reused (for example Instance). They are part of the plan key by reference, so allocating a fresh instance per query defeats the plan cache and grows the internal name cache. The override applies to the whole outer command; a convention set on a nested query is ignored.

Methods

ColumnName(string)

Converts a property name into its column name, for example FirstName to first_name.

string ColumnName(string propertyName)

Parameters

propertyName string

Returns

string

TableName(string, bool)

Converts the CLR table name (usually the type name).

string TableName(string clrName, bool isInterface)

Parameters

clrName string

The CLR type name, for example SimpleEntity.

isInterface bool

Whether the source type is an interface.

Returns

string