HumanReadableSerializerScrubExtensions Class

Provides extension methods for scrubbing values during serialization with HumanReadableSerializerOptions.

public static class HumanReadableSerializerScrubExtensions

Methods

NameDescription
ScrubGuid(HumanReadableSerializerOptions)Scrubs GUID values by replacing them with deterministic values based on their order of appearance.
ScrubValue<T>(HumanReadableSerializerOptions)Scrubs values of type T by replacing them with deterministic values like "TypeName_0", "TypeName_1", etc.
ScrubValue<T>(HumanReadableSerializerOptions, IEqualityComparer<T>?)Scrubs values of type T by replacing them with deterministic values, using the specified comparer to determine uniqueness.
ScrubValue<T>(HumanReadableSerializerOptions, Func<T, int, string>)Scrubs values of type T by replacing them with the result of the specified scrubber function that receives the value and its index.
ScrubValue<T>(HumanReadableSerializerOptions, Func<T, int, string>, IEqualityComparer<T>?)Scrubs values of type T by replacing them with the result of the specified scrubber function, using the specified comparer to determine uniqueness.
ScrubValue<T>(HumanReadableSerializerOptions, Func<T, string>)Scrubs values of type T by replacing them with the result of the specified scrubber function.
UseRelativeDateTime(HumanReadableSerializerOptions, DateTime)Serializes DateTime values relative to the specified origin.
UseRelativeDateTimeOffset(HumanReadableSerializerOptions, DateTimeOffset)Serializes DateTimeOffset values relative to the specified origin.
UseRelativeTimeSpan(HumanReadableSerializerOptions, TimeSpan)Serializes TimeSpan values relative to the specified origin.

ScrubGuid(HumanReadableSerializerOptions)

HumanReadableSerializerScrubExtensions.cs

Scrubs GUID values by replacing them with deterministic values based on their order of appearance.

public static void ScrubGuid(this HumanReadableSerializerOptions options)

ScrubValue overloads

ScrubValue<T>(HumanReadableSerializerOptions)

HumanReadableSerializerScrubExtensions.cs

Scrubs values of type T by replacing them with deterministic values like "TypeName_0", "TypeName_1", etc.

public static void ScrubValue<T>(this HumanReadableSerializerOptions options)
Type parameters
T
Parameters
options HumanReadableSerializerOptions

ScrubValue<T>(HumanReadableSerializerOptions, IEqualityComparer<T>?)

HumanReadableSerializerScrubExtensions.cs

Scrubs values of type T by replacing them with deterministic values, using the specified comparer to determine uniqueness.

public static void ScrubValue<T>(this HumanReadableSerializerOptions options, IEqualityComparer<T>? comparer)
Type parameters
T
Parameters
options HumanReadableSerializerOptions
comparer IEqualityComparer<T>?

ScrubValue<T>(HumanReadableSerializerOptions, Func<T, int, string>)

HumanReadableSerializerScrubExtensions.cs

Scrubs values of type T by replacing them with the result of the specified scrubber function that receives the value and its index.

public static void ScrubValue<T>(this HumanReadableSerializerOptions options, Func<T, int, string> scrubber)
Type parameters
T
Parameters
options HumanReadableSerializerOptions
scrubber Func<T, int, string>

ScrubValue<T>(HumanReadableSerializerOptions, Func<T, int, string>, IEqualityComparer<T>?)

HumanReadableSerializerScrubExtensions.cs

Scrubs values of type T by replacing them with the result of the specified scrubber function, using the specified comparer to determine uniqueness.

public static void ScrubValue<T>(this HumanReadableSerializerOptions options, Func<T, int, string> scrubber, IEqualityComparer<T>? comparer)
Type parameters
T
Parameters
options HumanReadableSerializerOptions
scrubber Func<T, int, string>
comparer IEqualityComparer<T>?

ScrubValue<T>(HumanReadableSerializerOptions, Func<T, string>)

HumanReadableSerializerScrubExtensions.cs

Scrubs values of type T by replacing them with the result of the specified scrubber function.

public static void ScrubValue<T>(this HumanReadableSerializerOptions options, Func<T, string> scrubber)
Type parameters
T
Parameters
options HumanReadableSerializerOptions
scrubber Func<T, string>

UseRelativeDateTime(HumanReadableSerializerOptions, DateTime)

HumanReadableSerializerScrubExtensions.cs

Serializes DateTime values relative to the specified origin.

public static void UseRelativeDateTime(this HumanReadableSerializerOptions options, DateTime origin)

UseRelativeDateTimeOffset(HumanReadableSerializerOptions, DateTimeOffset)

HumanReadableSerializerScrubExtensions.cs

Serializes DateTimeOffset values relative to the specified origin.

public static void UseRelativeDateTimeOffset(this HumanReadableSerializerOptions options, DateTimeOffset origin)

UseRelativeTimeSpan(HumanReadableSerializerOptions, TimeSpan)

HumanReadableSerializerScrubExtensions.cs

Serializes TimeSpan values relative to the specified origin.

public static void UseRelativeTimeSpan(this HumanReadableSerializerOptions options, TimeSpan origin)