---
title: Construct a DateRange
summary: Construct a DateRange from various inputs with sentinel defaulting.
status: draft
owner: saif-docgen
last_reviewed: 2026-09-15
library: SAIF.Framework.Common
reference_type: package
operation_id: OP-014
trigger: Caller creates a range
---

# Construct a DateRange

Construct a DateRange from various inputs with sentinel defaulting, triggered when caller creates a range.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-014 |
| **Trigger** | Caller creates a range |
| **Inputs** | none / `IDateRange` / `DateTime` / `DateTime, DateTime` |
| **Outputs** | `DateRange` instance |
| **Primary components** | ``DateRange` constructors (4 overloads) and `DateRange.Empty`` |
| **Entry point** | `Common/SAIF.Common/Classes/DateRange.cs` |

## Steps

1. Parameterless ctor: set `BeginDate = DateTime.MinValue`, `EndDate = DateTime.MaxValue` — the canonical unbounded range. ([BR-002](../business-rules.md#br-002-a-range-is-%22open-ended%22-when-begindate-is-datetime.minvalue-or-enddate-is-datetime.maxvalue), [BR-032](../business-rules.md#br-032-a-daterange-constructed-with-no-end-date-is-unbounded-forward))
2. Copy ctor: copy `BeginDate`/`EndDate` from the supplied `IDateRange` (no null guard).
3. Begin-only ctor: set the supplied begin date and default `EndDate` to `DateTime.MaxValue` (open-ended forward). ([BR-032](../business-rules.md#br-032-a-daterange-constructed-with-no-end-date-is-unbounded-forward))
4. Two-date ctor: assign both, then coerce `EndDate` to `DateTime.MaxValue` when the caller passed `DateTime.MinValue` — a MinValue end means "no end date". ([BR-033](../business-rules.md#br-033-an-end-date-supplied-as-datetime.minvalue-is-reinterpreted-as-no-end-date-and-coerced-to-datetime.maxvalue))
5. `DateRange.Empty` is a cached static parameterless-constructed instance (`MinValue`..`MaxValue`). ([BR-032](../business-rules.md#br-032-a-daterange-constructed-with-no-end-date-is-unbounded-forward))

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Caller constructs<br>a DateRange"]) --> S1["Parameterless ctor: BeginDate=MinValue,<br>EndDate=MaxValue"]
	S1 --> S2["Copy ctor: copy BeginDate/EndDate<br>from supplied IDateRange"]
	S2 --> S3["Begin-only ctor: set begin date,<br>default EndDate to MaxValue"]
	S3 --> D1{"Two-date ctor: EndDate<br>supplied as MinValue?"}
	D1 -->|Yes| S4a["Coerce EndDate<br>to MaxValue"]
	D1 -->|No| S4b["Assign both dates<br>as supplied"]
	S4a --> S5
	S4b --> S5["DateRange.Empty: cached<br>static instance (MinValue..MaxValue)"]
	S5 --> End([Return DateRange instance])
```

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `Common/SAIF.Common/Classes/DateRange.cs`
