RateBookExtensions Class
Definition
Provides extension methods that wrap an immutable RateBook in ready-to-query provider facades.
public static class RateBookExtensions
- Inheritance
-
RateBookExtensions
- Inherited Members
Methods
ToFixedProvider(RateBook)
Wraps the book in an immutable FixedDatedRateProvider, deriving the provider selection from the book's single provider per pair.
public static FixedDatedRateProvider ToFixedProvider(this RateBook book)
Parameters
bookRateBookThe immutable book to wrap.
Returns
- FixedDatedRateProvider
A provider resolving rates from
book.
Exceptions
- ArgumentNullException
Thrown when
bookis null.- ArgumentException
Thrown when
bookcontains two providers for the same pair; use ToFixedProvider(RateBook, IEnumerable<string>) to disambiguate.
ToFixedProvider(RateBook, IEnumerable<string>)
Wraps the book in an immutable FixedDatedRateProvider applying an explicit provider-priority list per pair.
public static FixedDatedRateProvider ToFixedProvider(this RateBook book, IEnumerable<string> providerPriority)
Parameters
bookRateBookThe immutable book to wrap.
providerPriorityIEnumerable<string>The ordered set of providers consulted for every pair. The first provider in this list that has a matching series for the pair wins; providers absent from the list are unreachable through the returned provider.
Returns
- FixedDatedRateProvider
A provider resolving rates from
bookunder the supplied priority.
Exceptions
- ArgumentNullException
Thrown when
bookorproviderPriorityis null.- ArgumentException
Thrown when
providerPriorityis empty or contains a null/whitespace entry.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |