/// <summary> /// Adds a serializer for a custom type. /// </summary> /// <param name="type">The custom type supported by the serializer.</param> /// <param name="serializer">The serializer for the custom type.</param> public Builder AddCustomType(Type type, CustomTypeSerializer serializer) { if (serializer == null) { throw new ArgumentNullException(nameof(serializer)); } if (serializer.TypeName == null) { throw new ArgumentException("serializer custom type name can not be null"); } _list.Add(new CustomTypeRegistryEntry(type, serializer)); return(this); }
/// <summary> /// Adds a serializer for a custom type. /// </summary> /// <param name="type">The custom type supported by the serializer.</param> /// <param name="serializer">The serializer for the custom type.</param> public Builder AddCustomType(Type type, CustomTypeSerializer serializer) { _builder.AddCustomType(type, serializer); return(this); }
public CustomTypeRegistryEntry(Type type, CustomTypeSerializer typeSerializer) { Type = type; TypeSerializer = typeSerializer; }