Table of Contents

Class ApiModuleOptionsBuilder<TSossObject>

Namespace
Scaleout.Modules.Hosting
Assembly
Scaleout.Modules.Hosting.dll

Provides a builder for configuring and creating instances of ApiModuleOptions<TSossObject>.

public class ApiModuleOptionsBuilder<TSossObject>

Type Parameters

TSossObject

The type of object in ScaleOut StateServer (SOSS) that's used by the module.

Inheritance
ApiModuleOptionsBuilder<TSossObject>
Inherited Members

Remarks

This class allows you to configure options such as the module's lock mode and serialization behavior. Use the provided methods to set the desired configuration, and call Build() to create a ApiModuleOptions<TSossObject> instance.

Constructors

ApiModuleOptionsBuilder()

Constructs a new instance of the ApiModuleOptionsBuilder<TSossObject> class.

public ApiModuleOptionsBuilder()

Methods

Build()

public ApiModuleOptions<TSossObject> Build()

Returns

ApiModuleOptions<TSossObject>

SetSerialization(Func<Stream, TSossObject>, Action<TSossObject, Stream>, bool)

Configures the serialization and deserialization behavior for the API module.

public ApiModuleOptionsBuilder<TSossObject> SetSerialization(Func<Stream, TSossObject> deserializer, Action<TSossObject, Stream> serializer, bool isJsonSerializer)

Parameters

deserializer Func<Stream, TSossObject>

A function that converts a Stream into an instance of TSossObject. This parameter cannot be null.

serializer Action<TSossObject, Stream>

An action that serializes an instance of TSossObject into a Stream. This parameter cannot be null.

isJsonSerializer bool

A value indicating whether the serializer and deserializer perform JSON serialization. true if JSON serialization is performed; otherwise, false for other serialization formats.

Returns

ApiModuleOptionsBuilder<TSossObject>

The updated ApiModuleOptionsBuilder<TSossObject> instance, allowing further configuration.

Exceptions

ArgumentNullException

Thrown if deserializer or serializer is null.