Table of Contents

IWeekendDefinitionProviderExtensions Class

Definition

Namespace
Bodu.Extensions
Assembly
Bodu.Core.dll
Package
Bodu.Core 1.0.1
Source
IWeekendDefinitionProviderExtensions.cs

Provides conversions from IWeekendDefinitionProvider to the canonical WeekPattern value type used by the working-week APIs.

public static class IWeekendDefinitionProviderExtensions
Inheritance
IWeekendDefinitionProviderExtensions
Inherited Members

Methods

ToWeekPattern(IWeekendDefinitionProvider)

Converts an IWeekendDefinitionProvider into the canonical WeekPattern whose selected days are the complement of the provider's weekend.

public static WeekPattern ToWeekPattern(this IWeekendDefinitionProvider provider)

Parameters

provider IWeekendDefinitionProvider

The provider whose weekend semantics are projected onto a WeekPattern.

Returns

WeekPattern

The working-week WeekPattern implied by provider.

Remarks

Use this helper when adapting an IWeekendDefinitionProvider implementation to APIs that accept a WeekPattern directly - for example, the WeekPattern-accepting NotableDateService constructor.

IWeekendDefinitionProvider provider = new MyCustomWeekend();
WeekPattern workingWeek = provider.ToWeekPattern();
var service = new NotableDateService(ruleProviders, workingWeek);

Exceptions

ArgumentNullException

Thrown when provider is null.

Applies to

ProductVersions
.NET8, 10