Struct NpgsqlRange<T>
Represents a PostgreSQL range type.
Implements
Namespace: NpgsqlTypes
Assembly: Npgsql.dll
Syntax
public readonly struct NpgsqlRange<T> : IEquatable<NpgsqlRange<T>>
Type Parameters
Name | Description |
---|---|
T | The element type of the values in the range. |
Remarks
Constructors
| Improve this Doc View SourceNpgsqlRange(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. |
Remarks
| Improve this Doc View SourceNpgsqlRange(T, bool, T, bool)
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. |
bool | 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. |
bool | upperBoundIsInclusive | True if the upper bound is part of the range (i.e. inclusive); otherwise, false. |
Remarks
| Improve this Doc View SourceNpgsqlRange(T, bool, bool, T, bool, bool)
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. |
bool | lowerBoundIsInclusive | True if the lower bound is is part of the range (i.e. inclusive); otherwise, false. |
bool | lowerBoundInfinite | True if the lower bound is indefinite (i.e. infinite or unbounded); otherwise, false. |
T | upperBound | The upper bound of the range. |
bool | upperBoundIsInclusive | True if the upper bound is part of the range (i.e. inclusive); otherwise, false. |
bool | upperBoundInfinite | True if the upper bound is indefinite (i.e. infinite or unbounded); otherwise, false. |
Remarks
Fields
| Improve this Doc View SourceEmpty
Represents the empty range. This field is read-only.
Declaration
public static readonly NpgsqlRange<T> Empty
Field Value
Type | Description |
---|---|
NpgsqlRange<T> |
Remarks
Properties
| Improve this Doc View SourceIsEmpty
True if the range is empty; otherwise, false.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
| Improve this Doc View SourceLowerBound
The lower bound of the range. Only valid when LowerBoundInfinite is false.
Declaration
public T LowerBound { get; }
Property Value
Type | Description |
---|---|
T |
Remarks
| Improve this Doc View SourceLowerBoundInfinite
True if the lower bound is indefinite (i.e. infinite or unbounded); otherwise, false.
Declaration
public bool LowerBoundInfinite { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
| Improve this Doc View SourceLowerBoundIsInclusive
True if the lower bound is part of the range (i.e. inclusive); otherwise, false.
Declaration
public bool LowerBoundIsInclusive { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
| Improve this Doc View SourceUpperBound
The upper bound of the range. Only valid when UpperBoundInfinite is false.
Declaration
public T UpperBound { get; }
Property Value
Type | Description |
---|---|
T |
Remarks
| Improve this Doc View SourceUpperBoundInfinite
True if the upper bound is indefinite (i.e. infinite or unbounded); otherwise, false.
Declaration
public bool UpperBoundInfinite { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
| Improve this Doc View SourceUpperBoundIsInclusive
True if the upper bound is part of the range (i.e. inclusive); otherwise, false.
Declaration
public bool UpperBoundIsInclusive { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Methods
| Improve this Doc View SourceEquals(NpgsqlRange<T>)
Declaration
public bool Equals(NpgsqlRange<T> other)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlRange<T> | other |
Returns
Type | Description |
---|---|
bool |
Remarks
| Improve this Doc View SourceEquals(object?)
Declaration
public override bool Equals(object? o)
Parameters
Type | Name | Description |
---|---|---|
object? | o |
Returns
Type | Description |
---|---|
bool |
Remarks
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Remarks
| Improve this Doc View SourceParse(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 |
---|---|---|
string | value | A PosgreSQL range type in a well-known text format. |
Returns
Type | Description |
---|---|
NpgsqlRange<T> | The NpgsqlRange<T> represented by the |
Remarks
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Remarks
Operators
| Improve this Doc View Sourceoperator ==(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 |
---|---|
bool | True if the NpgsqlRange<T> on the left is equal to the NpgsqlRange<T> on the right; otherwise, false. |
Remarks
| Improve this Doc View Sourceoperator !=(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 |
---|---|
bool | True if the NpgsqlRange<T> on the left is not equal to the NpgsqlRange<T> on the right; otherwise, false. |