PgRangeTypeAttribute
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Associates a mapped scalar bound with an existing PostgreSQL range type.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum, AllowMultiple = true, Inherited = false)]public sealed class PgRangeTypeAttribute : AttributeApply this attribute to a value type carrying PgDatumType. The scalar reader and writer convert finite bounds of PgRange<T>; PostgreSQL validates and canonicalizes the range itself. This declaration registers conversion and SQL metadata; it does not create a SQL range type. An extension-owned range requires a PgSqlTypeProvider for its exact PgRange<T> managed identity, independently of the scalar’s provider. External ranges require an explicit schema. Generic default declarations apply to finite selected scalar constructions. An explicit managed-type declaration selects one closed scalar construction and takes precedence over its optional default. Multidimensional arrays use one PgArray<PgRange<T>> container with the declared range identity.
Inheritance: object, Attribute
Constructors
Section titled “Constructors”PgRangeTypeAttribute(string)
Section titled “PgRangeTypeAttribute(string)”Associates a mapped scalar bound with an existing PostgreSQL range type.
public PgRangeTypeAttribute(string name)Parameters:
name — string
The exact unquoted PostgreSQL range type identifier.
Apply this attribute to a value type carrying PgDatumType. The scalar reader and writer convert finite bounds of PgRange<T>; PostgreSQL validates and canonicalizes the range itself. This declaration registers conversion and SQL metadata; it does not create a SQL range type. An extension-owned range requires a PgSqlTypeProvider for its exact PgRange<T> managed identity, independently of the scalar’s provider. External ranges require an explicit schema. Generic default declarations apply to finite selected scalar constructions. An explicit managed-type declaration selects one closed scalar construction and takes precedence over its optional default. Multidimensional arrays use one PgArray<PgRange<T>> container with the declared range identity.
PgRangeTypeAttribute(Type, string)
Section titled “PgRangeTypeAttribute(Type, string)”Associates one exact closed construction of the annotated scalar type with a SQL range type.
public PgRangeTypeAttribute(Type managedType, string name)Parameters:
managedType — Type
The closed scalar bound type whose definition carries this attribute.
name — string
The exact unquoted PostgreSQL range type identifier.
Properties
Section titled “Properties”ManagedType
Section titled “ManagedType”Gets the exact closed scalar bound identity, or null for the annotated type’s default range mapping.
public Type? ManagedType { get; }Value: Type
Gets the exact catalog range type identifier.
public string Name { get; }Value: string
Origin
Section titled “Origin”Gets or sets whether this extension supplies the range or an external schema already contains it.
public PgTypeOrigin Origin { get; set; }Value: PgTypeOrigin
Schema
Section titled “Schema”Gets or sets the range’s fixed schema. External ranges require an explicit schema.
public string? Schema { get; set; }Value: string