Method WithSerializerRegistry
- Namespace
- NATS.Extensions.Microsoft.DependencyInjection
- Assembly
- NATS.Extensions.Microsoft.DependencyInjection.dll
WithSerializerRegistry(INatsSerializerRegistry)
Override the default INatsSerializerRegistry for the options.
public NatsBuilder WithSerializerRegistry(INatsSerializerRegistry registry)
Parameters
registry
INatsSerializerRegistrySerializer registry to use.
Returns
- NatsBuilder
Builder to allow method chaining.
Remarks
This will be applied to options overriding values set for SerializerRegistry
in options.
By default, NatsClient registry will be used which allows ad-hoc JSON serialization.
Note that this is not the same as NatsOpts
default SerializerRegistry
which
doesn't do ad-hoc JSON serialization.