Search Results for

    Show / Hide Table of Contents

    Class NpgsqlSnakeCaseNameTranslator

    A name translator which converts standard CLR names (e.g. SomeClass) to snake-case database names (some_class)

    Inheritance
    object
    NpgsqlSnakeCaseNameTranslator
    Implements
    INpgsqlNameTranslator
    Namespace: Npgsql.NameTranslation
    Assembly: Npgsql.dll
    Syntax
    public sealed class NpgsqlSnakeCaseNameTranslator : INpgsqlNameTranslator

    Constructors

    | Improve this Doc View Source

    NpgsqlSnakeCaseNameTranslator(bool, CultureInfo?)

    Creates a new NpgsqlSnakeCaseNameTranslator.

    Declaration
    public NpgsqlSnakeCaseNameTranslator(bool legacyMode, CultureInfo? culture = null)
    Parameters
    Type Name Description
    bool legacyMode

    Uses the legacy naming convention if true, otherwise it uses the new naming convention.

    CultureInfo? culture

    An object that supplies culture-specific casing rules. This will be used when converting names to lower case. If null then will be used.

    | Improve this Doc View Source

    NpgsqlSnakeCaseNameTranslator(CultureInfo?)

    Creates a new NpgsqlSnakeCaseNameTranslator.

    Declaration
    public NpgsqlSnakeCaseNameTranslator(CultureInfo? culture = null)
    Parameters
    Type Name Description
    CultureInfo? culture

    An object that supplies culture-specific casing rules. This will be used when converting names to lower case. If null then will be used.

    Methods

    | Improve this Doc View Source

    ConvertToSnakeCase(string, CultureInfo)

    Converts a string to its snake_case equivalent.

    Declaration
    public static string ConvertToSnakeCase(string name, CultureInfo culture)
    Parameters
    Type Name Description
    string name

    The value to convert.

    CultureInfo culture

    An object that supplies culture-specific casing rules. This will be used when converting names to lower case. If null then will be used.

    Returns
    Type Description
    string
    | Improve this Doc View Source

    TranslateMemberName(string)

    Given a CLR member name (property or field), translates its name to a database type name.

    Declaration
    public string TranslateMemberName(string clrName)
    Parameters
    Type Name Description
    string clrName
    Returns
    Type Description
    string
    | Improve this Doc View Source

    TranslateTypeName(string)

    Given a CLR type name (e.g class, struct, enum), translates its name to a database type name.

    Declaration
    public string TranslateTypeName(string clrName)
    Parameters
    Type Name Description
    string clrName
    Returns
    Type Description
    string

    Implements

    INpgsqlNameTranslator
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team