It is quite common to be writing code that looks like:
getSomething()
.Map(something => {
if (!someCondition(something)) {
return Outcome<Something>.Reject("Description of failure");
}
return doSomething(something);
}
FailWhen will simplify this to:
getSomething()
.FailWhen(something => !someCondition(something), "Description of failure");
.Map(something => doSomething(something));
It is quite common to be writing code that looks like:
FailWhenwill simplify this to: