Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue caching Result<T> w/ HybridCache #223

Open
nwoolls opened this issue Sep 17, 2024 · 0 comments
Open

Issue caching Result<T> w/ HybridCache #223

nwoolls opened this issue Sep 17, 2024 · 0 comments

Comments

@nwoolls
Copy link

nwoolls commented Sep 17, 2024

Hi there. Love the library. We are use it all over the place and are looking to plug Microsoft's HybridCache in for a bit of caching in hot spots. However, the Value property of a successful Result<T> is null after retrieving it from the cache.

I've reproduced the issue here:

https://github.com/nwoolls/spl-fluentresults-caching-value-lost

Of course we could cache the underlying value, but then we need to essentially turn a failed Result<T> into an exception, handle the exception, and turn it back into a failed Result<T>, which feels a bit tedious if we're OK with caching failed results in some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant