예제 #1
0
        public static IRootContext With <T>(this IRootContext @this, Action <T> configure)
            where T : class, ISerializerExtension
        {
            var extension = @this.With <T>();

            configure(extension);
            return(@this);
        }
 /// <summary>
 /// Finds or creates/add the requested serializer extension type, and then configures it with the provided action once
 /// it does.
 /// </summary>
 /// <typeparam name="T">The requested serializer extension type.</typeparam>
 /// <param name="this">The root context to search for a serializer extension of provided type.</param>
 /// <param name="configure">The configuration action to invoke once the serializer extension has been located.</param>
 /// <returns>The configured context (usually a configuration container).</returns>
 public static IRootContext With <T>(this IRootContext @this, Action <T> configure)
     where T : class, ISerializerExtension
 => configure.Apply(@this.With <T>()).Return(@this);