Show / Hide Table of Contents

Struct NpgsqlRange<T>

Represents a PostgreSQL range type.

Implements
System.IEquatable<NpgsqlRange<T>>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: NpgsqlTypes
Assembly: Npgsql.dll
Syntax
public struct NpgsqlRange<T> : IEquatable<NpgsqlRange<T>>
Type Parameters
Name Description
T

The element type of the values in the range.

Remarks

See: https://www.postgresql.org/docs/current/static/rangetypes.html

Constructors

NpgsqlRange(T, T)

Constructs an NpgsqlRange<T> with inclusive and definite bounds.

Declaration
public NpgsqlRange(T lowerBound, T upperBound)
Parameters
Type Name Description
T lowerBound

The lower bound of the range.

T upperBound

The upper bound of the range.

NpgsqlRange(T, Boolean, T, Boolean)

Constructs an NpgsqlRange<T> with definite bounds.

Declaration
public NpgsqlRange(T lowerBound, bool lowerBoundIsInclusive, T upperBound, bool upperBoundIsInclusive)
Parameters
Type Name Description
T lowerBound

The lower bound of the range.

System.Boolean lowerBoundIsInclusive

True if the lower bound is is part of the range (i.e. inclusive); otherwise, false.

T upperBound

The upper bound of the range.

System.Boolean upperBoundIsInclusive

True if the upper bound is part of the range (i.e. inclusive); otherwise, false.

NpgsqlRange(T, Boolean, Boolean, T, Boolean, Boolean)

Constructs an NpgsqlRange<T>.

Declaration
public NpgsqlRange(T lowerBound, bool lowerBoundIsInclusive, bool lowerBoundInfinite, T upperBound, bool upperBoundIsInclusive, bool upperBoundInfinite)
Parameters
Type Name Description
T lowerBound

The lower bound of the range.

System.Boolean lowerBoundIsInclusive

True if the lower bound is is part of the range (i.e. inclusive); otherwise, false.

System.Boolean lowerBoundInfinite

True if the lower bound is indefinite (i.e. infinite or unbounded); otherwise, false.

T upperBound

The upper bound of the range.

System.Boolean upperBoundIsInclusive

True if the upper bound is part of the range (i.e. inclusive); otherwise, false.

System.Boolean upperBoundInfinite

True if the upper bound is indefinite (i.e. infinite or unbounded); otherwise, false.

Fields

Empty

Represents the empty range. This field is read-only.

Declaration
public static readonly NpgsqlRange<T> Empty
Field Value
Type Description
NpgsqlRange<T>

Properties

IsEmpty

True if the range is empty; otherwise, false.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
System.Boolean

LowerBound

The lower bound of the range. Only valid when LowerBoundInfinite is false.

Declaration
public T LowerBound { get; }
Property Value
Type Description
T

LowerBoundInfinite

True if the lower bound is indefinite (i.e. infinite or unbounded); otherwise, false.

Declaration
public bool LowerBoundInfinite { get; }
Property Value
Type Description
System.Boolean

LowerBoundIsInclusive

True if the lower bound is part of the range (i.e. inclusive); otherwise, false.

Declaration
public bool LowerBoundIsInclusive { get; }
Property Value
Type Description
System.Boolean

UpperBound

The upper bound of the range. Only valid when UpperBoundInfinite is false.

Declaration
public T UpperBound { get; }
Property Value
Type Description
T

UpperBoundInfinite

True if the upper bound is indefinite (i.e. infinite or unbounded); otherwise, false.

Declaration
public bool UpperBoundInfinite { get; }
Property Value
Type Description
System.Boolean

UpperBoundIsInclusive

True if the upper bound is part of the range (i.e. inclusive); otherwise, false.

Declaration
public bool UpperBoundIsInclusive { get; }
Property Value
Type Description
System.Boolean

Methods

Equals(NpgsqlRange<T>)

Declaration
public bool Equals(NpgsqlRange<T> other)
Parameters
Type Name Description
NpgsqlRange<T> other
Returns
Type Description
System.Boolean

Equals(Object)

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
System.Object o
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()

Parse(String)

Parses the well-known text representation of a PostgreSQL range type into a NpgsqlRange<T>.

Declaration
public static NpgsqlRange<T> Parse(string value)
Parameters
Type Name Description
System.String value

A PosgreSQL range type in a well-known text format.

Returns
Type Description
NpgsqlRange<T>

The NpgsqlRange<T> represented by the value.

Remarks

See: https://www.postgresql.org/docs/current/static/rangetypes.html

Exceptions
Type Condition
System.FormatException

Malformed range literal.

System.FormatException

Malformed range literal. Missing left parenthesis or bracket.

System.FormatException

Malformed range literal. Missing right parenthesis or bracket.

System.FormatException

Malformed range literal. Missing comma after lower bound.

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()

Operators

Equality(NpgsqlRange<T>, NpgsqlRange<T>)

Indicates whether the NpgsqlRange<T> on the left is equal to the NpgsqlRange<T> on the right.

Declaration
public static bool operator ==(NpgsqlRange<T> x, NpgsqlRange<T> y)
Parameters
Type Name Description
NpgsqlRange<T> x

The NpgsqlRange<T> on the left.

NpgsqlRange<T> y

The NpgsqlRange<T> on the right.

Returns
Type Description
System.Boolean

True if the NpgsqlRange<T> on the left is equal to the NpgsqlRange<T> on the right; otherwise, false.

Inequality(NpgsqlRange<T>, NpgsqlRange<T>)

Indicates whether the NpgsqlRange<T> on the left is not equal to the NpgsqlRange<T> on the right.

Declaration
public static bool operator !=(NpgsqlRange<T> x, NpgsqlRange<T> y)
Parameters
Type Name Description
NpgsqlRange<T> x

The NpgsqlRange<T> on the left.

NpgsqlRange<T> y

The NpgsqlRange<T> on the right.

Returns
Type Description
System.Boolean

True if the NpgsqlRange<T> on the left is not equal to the NpgsqlRange<T> on the right; otherwise, false.

Implements

System.IEquatable<T>
Back to top Generated by DocFX