Click or drag to resize

DatedDataValueFirstDay Property

Gets the first Day of the period covered by this DatedDataValue.

Namespace: DegreeDays.Api.Data
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public abstract Day FirstDay { get; }

Property Value

Day
Remarks

This is a convenience/performance property that should run faster (or at least not slower) than calling .DayRange.First, since calling DayRange may result in a temporary DayRange instance being created. We say "may" because that is an implementation detail that is subject to change.

A large request for data (daily data in particular) can easily result in hundreds of thousands of these DatedDataValue objects, each of which occupies memory and typically needs to be used by code that is repeating its operations on every single value in a set. So we've tried to design DatedDataValue to minimize memory footprint and enable fast access to its fields.

If all you want is the first day of the range, then this is the optimal property to call. If you want the last day of the range, then LastDay is the optimal property to call. But if you need more information then don't hesitate to get the DayRange as it is very lightweight and creating it is a very fast operation. Choosing the optimal property is very unlikely to make a practical difference unless performance is critically important to you and you're iterating over large quantities of daily data for which the DayRange is largely irrelevant anyway (since for daily data it would only cover a single day).

See Also