CSharpFunctionalExtensions
CSharpFunctionalExtensions copied to clipboard
On Result.Fail() I want to return the type
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?
Hi, is there an update to this? Can we now write return Result.Failure(new ErrorClass())?