Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexzeitler/martenfsharptypealiases
Some experiments with Marten DB and F# Type Aliases
https://github.com/alexzeitler/martenfsharptypealiases
dotnetcore eventsourcing fsharp fsharp-samples marten
Last synced: about 1 month ago
JSON representation
Some experiments with Marten DB and F# Type Aliases
- Host: GitHub
- URL: https://github.com/alexzeitler/martenfsharptypealiases
- Owner: AlexZeitler
- License: mit
- Created: 2021-05-15T19:06:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-16T01:26:27.000Z (over 3 years ago)
- Last Synced: 2024-10-12T12:09:16.693Z (4 months ago)
- Topics: dotnetcore, eventsourcing, fsharp, fsharp-samples, marten
- Language: F#
- Homepage:
- Size: 245 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MartenFSharpTypeAliases
This sample shows an Event Sourcing implementation with [Marten DB](https://github.com/JasperFx/marten) and F#.
The [Domain Model](https://github.com/AlexZeitler/MartenFSharpTypeAliases/blob/main/src/MartenFSharpTypeAliases/Program.fs#L131) contains Type Aliases as described [here](https://www.softwarepark.cc/blog/2020/8/7/understanding-f-type-aliases).
The challenge was to get the Marten serializer to serialize the Type alias
```fsharp
type CustomerNumber = CustomerNumber of string
```from this:
![Default Converters](assets/serialization_defaults.png)
to this:
![Custom Converters](assets/serialization_custom_converter.png)
The solution evolved in two steps: [Commit 1](https://github.com/AlexZeitler/MartenFSharpTypeAliases/pull/1/commits/01f7c18d91430587e45ee61a83999082ce4f4371), [Commit 2](https://github.com/AlexZeitler/MartenFSharpTypeAliases/pull/1/commits/0ecdfdcb7599a7cfe1637d4a15764ea1ebb9e62b).
Thanks to [Isaac Abraham](https://github.com/isaacabraham) for getting this done!