private static Range <T> TryCreateCore <T>( T from, RangeBoundaryFromKind fromKind, T to, RangeBoundaryToKind toKind) => RangeBoundaryFrom <T> .IsValid(from) && RangeBoundaryTo <T> .IsValid(to) ? TryCreate( RangeBoundaryFrom <T> .AdjustAndCreate(from, fromKind), RangeBoundaryTo <T> .AdjustAndCreate(to, toKind)) : Range <T> .Empty;
private static Range <T> TryCreateCore <T>( T from, RangeBoundaryFromKind fromKind, T to, RangeBoundaryToKind toKind) => IsValid(from, to) #pragma warning disable 618 // Validation not required: IsValid() called. ? new Range <T>( RangeBoundaryFrom <T> .AdjustAndCreate(from, fromKind), RangeBoundaryTo <T> .AdjustAndCreate(to, toKind), SkipsArgValidation) #pragma warning restore 618 : Range <T> .Empty;
public static RangeBoundaryTo <T> BoundaryToExclusive <T>(T toValue) => RangeBoundaryTo <T> .AdjustAndCreate(toValue, RangeBoundaryToKind.Exclusive);