HumanReadableSerializerScrubExtensions Class
Provides extension methods for scrubbing values during serialization with HumanReadableSerializerOptions.
public static class HumanReadableSerializerScrubExtensionsMethods
| Name | Description |
|---|---|
| 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.csScrubs GUID values by replacing them with deterministic values based on their order of appearance.
public static void ScrubGuid(this HumanReadableSerializerOptions options)Parameters
optionsHumanReadableSerializerOptions
ScrubValue overloads
ScrubValue<T>(HumanReadableSerializerOptions)
HumanReadableSerializerScrubExtensions.csScrubs values of type T by replacing them with deterministic values like "TypeName_0", "TypeName_1", etc.
public static void ScrubValue<T>(this HumanReadableSerializerOptions options)ScrubValue<T>(HumanReadableSerializerOptions, IEqualityComparer<T>?)
HumanReadableSerializerScrubExtensions.csScrubs 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)ScrubValue<T>(HumanReadableSerializerOptions, Func<T, int, string>)
HumanReadableSerializerScrubExtensions.csScrubs 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)ScrubValue<T>(HumanReadableSerializerOptions, Func<T, int, string>, IEqualityComparer<T>?)
HumanReadableSerializerScrubExtensions.csScrubs 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
optionsHumanReadableSerializerOptionsscrubberFunc<T, int, string>comparerIEqualityComparer<T>?
ScrubValue<T>(HumanReadableSerializerOptions, Func<T, string>)
HumanReadableSerializerScrubExtensions.csScrubs 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)UseRelativeDateTime(HumanReadableSerializerOptions, DateTime)
HumanReadableSerializerScrubExtensions.csSerializes DateTime values relative to the specified origin.
public static void UseRelativeDateTime(this HumanReadableSerializerOptions options, DateTime origin)Parameters
optionsHumanReadableSerializerOptionsoriginDateTime
UseRelativeDateTimeOffset(HumanReadableSerializerOptions, DateTimeOffset)
HumanReadableSerializerScrubExtensions.csSerializes DateTimeOffset values relative to the specified origin.
public static void UseRelativeDateTimeOffset(this HumanReadableSerializerOptions options, DateTimeOffset origin)Parameters
optionsHumanReadableSerializerOptionsoriginDateTimeOffset
UseRelativeTimeSpan(HumanReadableSerializerOptions, TimeSpan)
HumanReadableSerializerScrubExtensions.csSerializes TimeSpan values relative to the specified origin.
public static void UseRelativeTimeSpan(this HumanReadableSerializerOptions options, TimeSpan origin)Parameters
optionsHumanReadableSerializerOptionsoriginTimeSpan