Skip to content

PgName is supposed to be specified on types, but this isn't listed in the attribute usage #3390

Closed

Description

@YohDeadfall

Probably it was missed somehow, since composite and enum mappings are using PgNameAttribute to get the PostgreSQL type name.

static string GetPgName<T>(INpgsqlNameTranslator nameTranslator)
=> typeof(T).GetCustomAttribute<PgNameAttribute>()?.PgName
?? nameTranslator.TranslateTypeName(typeof(T).Name);

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter)]
public class PgNameAttribute : Attribute

Activity

  1. added this to the 4.1.7 milestone on Dec 4, 2020
  2. self-assigned this
    on Dec 4, 2020
  3. added 3 commits that reference this issue on Dec 8, 2020
    7f581c7
    48d94ee
    c9bbf75
  4. added theissue type on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions