-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
The method is returning object as Result<Result<dynamic>> instead of Result<dynamic> since version 3.7 #144
Comments
Hi, in the release notes I see that we added a new implicit conversation in v3.7 (see https://github.com/altmann/FluentResults/releases/tag/v3.7) Issue and PR is also linked. I think that the method WithValue() works correctly. But after WithValue() an implicit conversation occur and the Result is wrapped in another Result object but I don't really know why. The git repo of FluentResult is really easy to setup locally on a dev machine. Only cloning and building. If you need a solution asap it would be great if you can create a test to reproduce this issue and maybe you find the solution. Maybe we have to check in the implicit conversation if the TValue is already a Result and then we can return it and don't wrap it again. |
I did create a test locally in fluent results repo, i can push the branch if you would like ? However, i am not sure if i have the time to fix the bug currently, although would be nice to have the solution asap. I will try to fix it once i have some free time myself, but would be great if some one can really look into it until then. Thanks a lot |
@kuldeepGDI I invested some time and have now a working solution. I don't have much experience with dynamic in c# because I try to prevent it in all my projects. Please look at the pr #145. There you see the changes and also the test which I added. Please let me know your opinion. |
I added my comment there, when would be the new version published then ? THanks a lot for quick fix ! |
The new version 3.11 is released in some minutes. I keep the issue open. If you know why its double casted please let me know. |
Hi,
since the update of fluentResults to 3.7 we are facing following issue. We have a code which functions as following
this was working fine until 3.6. After updating to 3.7 we notice that now result.WithValue is returning Result of Result object however earlier (version 3.6) it was returning simple Result object, As an example on version 3.7+ we now get
however on prior versions 3.6 and below we get
in both above cases
ON debugging i found that somehow with 3.7 now there is an extra call occurring to following method in Results.cs file
And this is leading to an extra wrapping of Result object
Any hints?
The text was updated successfully, but these errors were encountered: