# Class PostgresRange

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Metadata

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

Represents the metadata for a PostgreSQL range.

    public class PostgresRange

Inheritance
  object
  PostgresRange

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Properties

### Annotatable

The Annotatable that stores the range.

    public virtual Annotatable Annotatable { get; }

#### Property Value

Annotatable

### CanonicalFunction

The function defining a "step" in a discrete range.

    public virtual string? CanonicalFunction { get; set; }

#### Property Value

string

### Collation

The collation to use.

    public virtual string? Collation { get; set; }

#### Property Value

string

### Name

The range name.

    public virtual string Name { get; }

#### Property Value

string

### Schema

The range schema or null to represent the default schema.

    public virtual string? Schema { get; }

#### Property Value

string

### Subtype

The subtype of the range.

    public virtual string Subtype { get; set; }

#### Property Value

string

### SubtypeDiff

The function defining a difference in subtype values.

    public virtual string? SubtypeDiff { get; set; }

#### Property Value

string

### SubtypeOpClass

The operator class to use.

    public virtual string? SubtypeOpClass { get; set; }

#### Property Value

string

## Methods

### FindPostgresRange(IReadOnlyAnnotatable, string?, string)

Finds a PostgresRange in the IAnnotatable, or returns null if not found.

    public static PostgresRange? FindPostgresRange(IReadOnlyAnnotatable annotatable, string? schema, string name)

#### Parameters

`annotatable` IReadOnlyAnnotatable

  The annotatable to search for the range.

`schema` string

  The range schema or null to use the model's default schema.

`name` string

  The range name.

#### Returns

PostgresRange

  The PostgresRange from the IAnnotatable.

#### Exceptions

ArgumentException

  `schema`

ArgumentNullException

  `annotatable`

ArgumentNullException

  `name`

### GetOrAddPostgresRange(IMutableAnnotatable, string?, string, string, string?, string?, string?, string?)

Gets or adds a PostgresRange from or to the IMutableAnnotatable.

    public static PostgresRange GetOrAddPostgresRange(IMutableAnnotatable annotatable, string? schema, string name, string subtype, string? canonicalFunction = null, string? subtypeOpClass = null, string? collation = null, string? subtypeDiff = null)

#### Parameters

`annotatable` IMutableAnnotatable

  The annotatable from which to get or add the range.

`schema` string

  The range schema or null to use the model's default schema.

`name` string

  The range name.

`subtype` string

  The range subtype.

`canonicalFunction` string
`subtypeOpClass` string
`collation` string
`subtypeDiff` string

#### Returns

PostgresRange

  The PostgresRange from the IMutableAnnotatable.

#### Exceptions

ArgumentException

  `schema`

ArgumentNullException

  `annotatable`

ArgumentNullException

  `name`

ArgumentNullException

  `subtype`

### GetPostgresRanges(IReadOnlyAnnotatable)

Gets the collection of PostgresRange stored in the IAnnotatable.

    public static IEnumerable<PostgresRange> GetPostgresRanges(IReadOnlyAnnotatable annotatable)

#### Parameters

`annotatable` IReadOnlyAnnotatable

  The annotatable to search for PostgresRange annotations.

#### Returns

IEnumerable<PostgresRange>

  The collection of PostgresRange stored in the IAnnotatable.

#### Exceptions

ArgumentNullException

  `annotatable`