Class RangeColumnsAttribute
Declares that a Range<T> property is stored as a pair of scalar columns instead of a
single range column. This is the storage model for providers without a native range type
(SQL Server, MySQL, MariaDB, SQLite, ClickHouse); PostgreSQL stores Range<T> natively
and does not need it. The lower and upper bounds are written to and read from the two named columns;
a SQL NULL bound means the corresponding side is unbounded.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class RangeColumnsAttribute : Attribute
- Inheritance
-
RangeColumnsAttribute
- Inherited Members
- Extension Methods
Remarks
The pair can only represent finite and unbounded ranges, not the empty range: two NULL
columns read back as the fully unbounded range. Bound inclusivity is declared on the attribute
(defaulting to the PostgreSQL canonical [lower, upper)) and is part of the mapping, not of
the stored values.
Constructors
RangeColumnsAttribute(string, string)
Declares the two columns holding the lower and upper bounds of the range.
public RangeColumnsAttribute(string lowerColumn, string upperColumn)
Parameters
lowerColumnstringThe column that stores the lower bound.
upperColumnstringThe column that stores the upper bound.
Properties
LowerColumn
The column that stores the lower bound.
public string LowerColumn { get; }
Property Value
LowerInclusive
Whether the lower bound is part of the range. Defaults to true.
public bool LowerInclusive { get; init; }
Property Value
UpperColumn
The column that stores the upper bound.
public string UpperColumn { get; }
Property Value
UpperInclusive
Whether the upper bound is part of the range. Defaults to false.
public bool UpperInclusive { get; init; }