NotableDateServiceExtensions Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
Provides convenience query extension methods over INotableDateService, including a by-year overload that resolves a full civil year.
public static class NotableDateServiceExtensions
- Inheritance
-
NotableDateServiceExtensions
- Inherited Members
Examples
INotableDateService service = AmericasCalendarData.CreateService("US");
// Resolve a whole civil year in one call.
IReadOnlyList<NotableDate> all = service.Resolve(2026, "US");
// Or restrict to non-working public holidays.
NotableDateFilter holidays = NotableDateFilter
.ForCategory(NotableDateCategory.PublicHoliday)
.And(NotableDateFilter.IsNonWorkingDay());
IReadOnlyList<NotableDate> publicHolidays = service.Resolve(2026, "US", holidays);
Methods
Resolve(INotableDateService, int, string)
Resolves every notable-date occurrence emitted in a civil year for the requested territory.
public static IReadOnlyList<NotableDate> Resolve(this INotableDateService service, int year, string territory)
Parameters
serviceINotableDateServiceThe service used to resolve notable dates.
yearintThe civil year to resolve.
territorystringThe requested territory code.
Returns
- IReadOnlyList<NotableDate>
The occurrences emitted in the year, ordered by date then identity.
Exceptions
- ArgumentNullException
serviceorterritoryis null.- ArgumentOutOfRangeException
yearis not a valid year.
Resolve(INotableDateService, int, string, NotableDateFilter)
Resolves the notable-date occurrences emitted in a civil year for the requested territory, restricted to those matching the supplied filter.
public static IReadOnlyList<NotableDate> Resolve(this INotableDateService service, int year, string territory, NotableDateFilter filter)
Parameters
serviceINotableDateServiceThe service used to resolve notable dates.
yearintThe civil year to resolve.
territorystringThe requested territory code.
filterNotableDateFilterThe filter that emitted occurrences must satisfy.
Returns
- IReadOnlyList<NotableDate>
The matching occurrences emitted in the year, ordered by date then identity.
Exceptions
- ArgumentNullException
service,territory, orfilteris null.- ArgumentOutOfRangeException
yearis not a valid year.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |