# Namespace Npgsql.EntityFrameworkCore.PostgreSQL.Metadata.Conventions

### Classes

NpgsqlConventionSetBuilder

  A builder for building conventions for Npgsql.

NpgsqlJsonElementHackConvention

  This convention is a hack around https://github.com/dotnet/efcore/issues/32192. To support the EF owned entity JSON support, EF requires that a lookup of the CLR type JsonElement return the provider's special JsonTypeMapping. But Npgsql has its own JSON DOM support, where actually mapping JsonElement is allowed as a weakly-typed mapping strategy. The two JSON type mappings are incompatible notably because EF's JsonTypeMapping is expected to return UTF8 byte data which is then parsed via Utf8JsonWriter (and not a string). So for properties actually typed as JsonElement, we hack here and set the type mapping rather than going through the regular type mapping process.

NpgsqlPostgresModelFinalizingConvention

  A convention that discovers certain common PostgreSQL extensions based on store types used in the model (e.g. hstore).

NpgsqlRuntimeModelConvention

  A convention that creates an optimized copy of the mutable model.

NpgsqlSharedTableConvention

  A convention that manipulates names of database objects for entity types that share a table to avoid clashes.

NpgsqlStoreGenerationConvention

  A convention that ensures that properties aren't configured to have a default value, as computed column or using a NpgsqlValueGenerationStrategy at the same time.

NpgsqlValueGenerationConvention

  A convention that configures store value generation as OnAdd on properties that are part of the primary key and not part of any foreign keys, were configured to have a database default value or were configured to use a NpgsqlValueGenerationStrategy. It also configures properties as OnAddOrUpdate if they were configured as computed columns.

NpgsqlValueGenerationStrategyConvention

  A convention that configures the default model NpgsqlValueGenerationStrategy as IdentityByDefaultColumn for newer PostgreSQL versions, and SerialColumn for pre-10.0 versions.