Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

40three/LanguageExt.Bson

Repository files navigation

LanguageExt.Bson

Build Status

This library provides BSON-serializers for MongoDB.Bson for most LanguageExt containers.

Nuget

Package Description
LanguageExt.Bson Provides the serializers
LanguageExt.Bson.DependencyInjection Provides IServiceCollection extensions

Setup

Call LanguageExtBsonSerializer.Setup at least once. Once you have done so, all supported types will be (de)serializable to and from BSON. Alternatively, include LanguageExt.Bson.DependencyInjection and call the AddLanguageExtBsonSerializers extension method on your IServiceCollection. This is functionally the same thing, as all MongoDB.Bson setup is held in a global variable anyway.

Supported Types

Type Serialized as
Option<A> Some<A> as A, None as BsonNull
Lst<A> BsonArray
Seq<A> BsonArray
Set<A> BsonArray
Map<string,A> BsonDocument with the keys as element names
Map<A,B> Analogous to DictionaryRepresentation.ArrayOfDocuments, that is, a BsonArray consisting of {"k": a, "v": b} documents

Future Work

  • Allow Map<string,A> to be serialized as an ArrayOfDocuments, too, if desired.
  • Implement a serializer for Either

About

Serialize LanguageExt-Containers to and from BSON

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.