Skip to content

Commit

Permalink
Change register() namespace (#15)
Browse files Browse the repository at this point in the history
`register()` now lives in `MongoDB.Bson.Serialization` namespace.
  • Loading branch information
pchalamet authored Dec 28, 2024
1 parent 9764b95 commit ca4a0f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ FSharp.MongoDB | [![Nuget](https://img.shields.io/nuget/v/FSharp.MongoDB)](https

On startup you have to register serializers:
```ocaml
MongoDB.Bson.Serialization.FSharpSerializer.register()
MongoDB.Bson.Serialization.FSharp.register()
```

# License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ open MongoDB.Bson.Serialization.Serializers

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
[<RequireQualifiedAccess>]
module FSharpSerializer =
module FSharp =

/// <summary>
/// Provides (de)serialization of F# data types, including lists, maps, options, records, sets,
Expand Down
4 changes: 2 additions & 2 deletions tests/FSharp.MongoDB.Bson.Tests/SerializationTestHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ open MongoDB.Bson.Serialization
module Helpers =

let serialize<'T> (value: 'T) =
FSharpSerializer.register()
FSharp.register()

let doc = BsonDocument()
use writer = new BsonDocumentWriter(doc, BsonDocumentWriterSettings.Defaults)
Expand All @@ -33,7 +33,7 @@ module Helpers =
doc

let deserialize<'T> doc =
FSharpSerializer.register()
FSharp.register()

use reader = new BsonDocumentReader(doc, BsonDocumentReaderSettings.Defaults)
BsonSerializer.Deserialize<'T>(reader)

0 comments on commit ca4a0f1

Please sign in to comment.