Table of Contents

NotableDateServiceExtensions Class

Definition

Namespace
Bodu.Globalization.Calendar
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.0.1
Source
NotableDateServiceExtensions.cs

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

service INotableDateService

The service used to resolve notable dates.

year int

The civil year to resolve.

territory string

The requested territory code.

Returns

IReadOnlyList<NotableDate>

The occurrences emitted in the year, ordered by date then identity.

Exceptions

ArgumentNullException

service or territory is null.

ArgumentOutOfRangeException

year is 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

service INotableDateService

The service used to resolve notable dates.

year int

The civil year to resolve.

territory string

The requested territory code.

filter NotableDateFilter

The 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, or filter is null.

ArgumentOutOfRangeException

year is not a valid year.

Applies to

ProductVersions
.NET8, 10

See Also