Click or drag to resize

LatestValuesPeriodWithMinimumNumberOfValues Method

Returns a new LatestValuesPeriod with the same NumberOfValues as this, but also specifying minimumNumberOfValues as the minimum number of values required.

Namespace: DegreeDays.Api.Data.Impl
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public LatestValuesPeriod WithMinimumNumberOfValues(
	int minimumNumberOfValues
)

Parameters

minimumNumberOfValues  Int32
The minimum number of values that the returned LatestValuesPeriod object should hold. Must be between 1 and NumberOfValues (both inclusive).

Return Value

LatestValuesPeriod
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionminimumNumberOfValues is less than 1 or greater than NumberOfValues.
Remarks

A LatestValuesPeriod created through the constructor does not have an explicit minimum number of values. Without a minimum, the API can decide what to do if there is not enough data available to satisfy the NumberOfValues requested, and it will typically return as many values as it can. If this method is used to specify a minimum number of values, then a request for data will fail unless that minimum number of values can be satisfied.

The following example shows typical usage of this method:

LatestValuesPeriod period = 
    new LatestValuesPeriod(targetNo).WithMinimumNumberOfValues(minimumNo);
See Also