Table of Contents

DuplicatePolicy Enum

Definition

Namespace
Bodu.Globalization.Calendar.RangeResolution
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.0.1
Source
DuplicatePolicy.cs

Determines how the loader treats two rules that resolve to the same full identity within a resource graph.

public enum DuplicatePolicy
Extension Methods

Fields

Error = 0

Report a duplicate identity as a validation error.

KeepFirst = 1

Keep the first rule encountered and discard later duplicates.

KeepLast = 2

Keep the last rule encountered and discard earlier duplicates.

Merge = 3

Merge duplicate rules into a single rule.

Remarks

The recommended default is Error, which surfaces accidental rule collapse rather than hiding it.

// The same concept emitted twice for one day (for example by overlapping rules):
// KeepFirst drops the later duplicate, Error fails the resolve. Set via the policy:
NotableDateDocumentBuilder.Create("demo")
    .WithResolutionPolicy(p => p.WithDuplicatePolicy(DuplicatePolicy.KeepFirst));

Applies to

ProductVersions
.NET8, 10

See Also