Exemple #1
0
 public static ITypeConfiguration <T> Alter <T>(this ITypeConfiguration <T> @this, Func <T, T> read, Func <T, T> write)
 => @this.Alter(new DelegatedAlteration <T>(read), new DelegatedAlteration <T>(write));
Exemple #2
0
 /// <summary>
 /// Used to alter an instance of the configured result type whenever it is encountered during the serialization
 /// process.  This can be used in scenarios where it is desired to know when an instance of a particular type is
 /// emitted (for logging purposes, etc.) or, more generally, to alter it in some way (scrubbing data, etc)
 /// before it is written to the external stream.  You can consider this as a value interception of
 /// the serialization pipeline.
 /// </summary>
 /// <typeparam name="T">The type under configuration.</typeparam>
 /// <param name="this">The type configuration to configure.</param>
 /// <param name="write">The alteration delegate to invoke during writing.</param>
 /// <returns>The configured type configuration.</returns>
 public static ITypeConfiguration <T> Alter <T>(this ITypeConfiguration <T> @this, Func <T, T> write)
 => @this.Alter(Self.Of <T>(), write);