This repository was archived by the owner on Jan 16, 2024. It is now read-only.
Repository navigation
Support for persistence to EventStoreDB. Fixes #3 - #4
Merged
Merged
Conversation
…tion working. Upgrading to .NET 5.0 should fix this as it supports working with classes without default constructors dotnet/runtime#29895
| public static EventData ToEventData(this IEventSerializer @eventSerializer, object @event, string eventName) | ||
| { | ||
| var eventPersistenceData = eventSerializer.GetPersistenceData(@event, eventName); | ||
| return new EventData(eventPersistenceData.EventId, eventPersistenceData.EventName, eventPersistenceData.IsJsonBytes, eventPersistenceData.EventData, eventPersistenceData.EventMetadata); |
Collaborator
There was a problem hiding this comment.
Dude wrap this 😛
…on fixes that allow JSON to be deserialized into classes without default constructors
… in the first instance and centralise the logic for mapping event names to types and vice versa
jonclare
marked this pull request as ready for review
October 26, 2020 16:07
daniel-smith
suggested changes
Oct 26, 2020
| _routes = ImmutableDictionary.CreateRange(routes); | ||
| EventNameMappings = eventNameMappings; | ||
| } | ||
|
|
Owner
There was a problem hiding this comment.
Can we rename the interface to IEventNameMap, and the implementation to EventNameMap? Then the property here can also be called EventNameMap. Seems a bit more concise and consistent.
| public async Task<long> SaveEventsAsync<TEvent>(string streamName, long expectedStreamVersion, IEnumerable<TEvent> events) | ||
| { | ||
| var eventDatas = events.Select(e => _serializer.ToEventData(e)); | ||
|
|
Owner
There was a problem hiding this comment.
Should we have an issue to address this TODO?
| } | ||
|
|
||
| private static string DetermineEventNameForClrType(Type clrType) | ||
| { |
Owner
There was a problem hiding this comment.
Should this comment be part of a proper documentation comment somewhere?
Collaborator
Author
There was a problem hiding this comment.
I'll set up a proper wiki site where we can document usage properly.
daniel-smith
approved these changes
Oct 27, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.