Result.Net
Result.Net copied to clipboard
Result.Net provides a result object to be used as a wrapper over operations execution results to indicate success or failure, instead of throwing exceptions or returning false without explanation.
``` catch (Exception ex) { return Result.Failure() .WithMessage("an internal exception has been thrown") .WithCode(ResultCode.OperationFailedException) .WithError(ex); } ``` ``` System.NotSupportedException HResult=0x80131515 Message=Serialization and deserialization of 'System.Reflection.MethodBase' instances is not supported. Path:...
The original exception type makes a difference, but the ToResult method discards this information. In any cases that need to know the original exception, ToResult is unusable. It is possible...