Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Monads in action
protected override ValidationResults OnValidate(PurchaseTransaction purchaseTransaction)
{
return purchaseTransaction
.With(ValidationCheck)
.Unless(IsValidateServiceDown)
.Try(SendMessageToTransecure)
.InCaseOfException(MarkServiceAsDown)
.Return(TheResult, OrFailureCodeInCaseOfFailure);
}
@pjvds

This comment has been minimized.

Copy link

@pjvds pjvds commented May 4, 2011

Looks interesting, was this just an example or is it a piece from running code?

@marcofranssen

This comment has been minimized.

Copy link

@marcofranssen marcofranssen commented May 14, 2011

Really cool... Mention how the implementation of these methods look like. Can you share?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment