oskardudycz / EventSourcing.NetCore

Examples and Tutorials of Event Sourcing in .NET
https://event-driven.io
Creative Commons Attribution Share Alike 4.0 International
3.42k stars 515 forks source link

GetAndUpdate with Maybe<object> calls the GetAndUpdate overload with Func<T, object> instead of Func <T, Maybe<object>> #198

Closed agross closed 1 year ago

agross commented 1 year ago

I just found this rather by accident:

When you return a Maybe<object> from the GetAndUpdate handler, the Maybe itself is persisted instead of the wrapped object. C# seems to prefer the overload with Func<T, object>.

Here's an example, I used "Go to definition".