Class SerializerRegistryExtensions
- Namespace
- Excalibur.Dispatch.Serialization
- Assembly
- Excalibur.Dispatch.Abstractions.dll
Extension methods for ISerializerRegistry.
public static class SerializerRegistryExtensions
- Inheritance
-
SerializerRegistryExtensions
- Inherited Members
Remarks
Provides convenience query methods that delegate to the core ISerializerRegistry methods.
Methods
GetByName(ISerializerRegistry, string)
Gets a serializer by its name.
public static ISerializer? GetByName(this ISerializerRegistry registry, string name)
Parameters
registryISerializerRegistryThe serializer registry.
namestringThe serializer name.
Returns
- ISerializer
The serializer, or null if not registered.
Exceptions
- ArgumentNullException
Thrown when registry is null.
- ArgumentException
Thrown when name is null or whitespace.
IsRegistered(ISerializerRegistry, byte)
Checks whether a serializer with the specified ID is registered.
public static bool IsRegistered(this ISerializerRegistry registry, byte id)
Parameters
registryISerializerRegistryThe serializer registry.
idbyteThe serializer ID to check.
Returns
- bool
True if a serializer with the specified ID is registered, false otherwise.
Exceptions
- ArgumentNullException
Thrown when registry is null.
IsRegistered(ISerializerRegistry, string)
Checks whether a serializer with the specified name is registered.
public static bool IsRegistered(this ISerializerRegistry registry, string name)
Parameters
registryISerializerRegistryThe serializer registry.
namestringThe serializer name to check.
Returns
- bool
True if a serializer with the specified name is registered, false otherwise.
Exceptions
- ArgumentNullException
Thrown when registry is null.