Class BsonOptions
This class provides options for configuring BSON serialization for Primitively types.
Inheritance
object
BsonOptions
Namespace: Primitively.MongoDB.Bson
Assembly: Primitively.MongoDB.Bson.dll
Syntax
public class BsonOptions
Properties
RegisterSerializersForEachTypeInRegistry
Gets or sets a value indicating whether to register BSON serializers for each type in the Primitively registry.
Declaration
public bool RegisterSerializersForEachTypeInRegistry { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Configure<TBsonSerializerOptions>(Action<TBsonSerializerOptions>)
Configures the specified BSON serializer options.
Declaration
public BsonOptions Configure<TBsonSerializerOptions>(Action<TBsonSerializerOptions> options) where TBsonSerializerOptions : class, IBsonSerializerOptions
Parameters
| Type | Name | Description |
|---|---|---|
| Action<TBsonSerializerOptions> | options | A delegate to configure the BSON serializer options. |
Returns
| Type | Description |
|---|---|
| BsonOptions | The same instance of the BsonOptions for chaining calls. |
Type Parameters
| Name | Description |
|---|---|
| TBsonSerializerOptions | The type of the BSON serializer options. |
Register(IPrimitiveRepository)
Registers the specified Primitively repository.
Declaration
public BsonOptions Register(IPrimitiveRepository repository)
Parameters
| Type | Name | Description |
|---|---|---|
| IPrimitiveRepository | repository | The Primitively repository. |
Returns
| Type | Description |
|---|---|
| BsonOptions | The same instance of the BsonOptions for chaining calls. |
Register<TPrimitive>()
Registers the specified Primitively type.
Declaration
public BsonOptions Register<TPrimitive>() where TPrimitive : struct, IPrimitive
Returns
| Type | Description |
|---|---|
| BsonOptions | The same instance of the BsonOptions for chaining calls. |
Type Parameters
| Name | Description |
|---|---|
| TPrimitive | The type of the Primitively type. |