RateLookupResultExtensions Class
Definition
Provides audit-convenience members for RateLookupResult that describe how the resolved rate relates to the requested date, keeping those derived helpers off the core result type.
public static class RateLookupResultExtensions
- Inheritance
-
RateLookupResultExtensions
- Inherited Members
Remarks
Each member is a thin projection over the result's backing data, its resolved rate, the requested date, and the recorded day offset, carrying no state of its own.
When compiled with a tool-chain that supports C# 14 extension members the helpers are exposed as extension
properties (for example result.IsExactDate); otherwise they compile as classic extension methods (for example
result.IsExactDate()).
Methods
IsExactDate(RateLookupResult)
Returns a value indicating whether the resolved rate is observed on the requested date.
public static bool IsExactDate(this RateLookupResult result)
Parameters
resultRateLookupResultThe lookup outcome to inspect.
Returns
- bool
true when OffsetDays is zero; otherwise false.
IsFutureDate(RateLookupResult)
Returns a value indicating whether the resolved observation post-dates the requested date.
public static bool IsFutureDate(this RateLookupResult result)
Parameters
resultRateLookupResultThe lookup outcome to inspect.
Returns
- bool
true when the resolved observation falls strictly after RequestedDate; otherwise false.
IsPreviousDate(RateLookupResult)
Returns a value indicating whether the resolved observation predates the requested date.
public static bool IsPreviousDate(this RateLookupResult result)
Parameters
resultRateLookupResultThe lookup outcome to inspect.
Returns
- bool
true when the resolved observation falls strictly before RequestedDate; otherwise false.
ResolvedDate(RateLookupResult)
Returns the calendar date of the observation actually selected by the lookup, as carried by Rate.
public static DateOnly ResolvedDate(this RateLookupResult result)
Parameters
resultRateLookupResultThe lookup outcome to inspect.
Returns
- DateOnly
The date the resolved rate is observed on.
SignedOffsetDays(RateLookupResult)
Returns the signed difference, in days, from RequestedDate to the resolved observation date.
public static int SignedOffsetDays(this RateLookupResult result)
Parameters
resultRateLookupResultThe lookup outcome to inspect.
Returns
- int
A negative value when the resolved observation predates the request (PreviousOnOrBefore fallback), a positive value when it post-dates the request (NextOnOrAfter fallback), or zero for an exact match.
Remarks
Accounting and tax workflows typically distinguish between historical and forward-looking fallbacks; this member surfaces that distinction without forcing the caller to recompute it from OffsetDays.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |