CSharpFunctionalExtensions icon indicating copy to clipboard operation
CSharpFunctionalExtensions copied to clipboard

On Result.Fail() I want to return the type

Open AkbaraliShaikh opened this issue 6 years ago • 1 comments

Result.Fail() only takes the error string, I'm looking for something where I can pass my type while creating the Fail() like

return Result.Fail(ApiResponse { Status = 1, Message = "Testing" });

and OnFailure I should be able to use those values

result.OnFailure(x=> {
x.Message
});

How Can do this?

AkbaraliShaikh avatar May 15 '19 16:05 AkbaraliShaikh

Hi, is there an update to this? Can we now write return Result.Failure(new ErrorClass())?

jboyflaga avatar Jan 31 '20 13:01 jboyflaga