Created
May 3, 2011 13:10
-
-
Save SzymonPobiega/953302 to your computer and use it in GitHub Desktop.
Monads in action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override ValidationResults OnValidate(PurchaseTransaction purchaseTransaction) | |
{ | |
return purchaseTransaction | |
.With(ValidationCheck) | |
.Unless(IsValidateServiceDown) | |
.Try(SendMessageToTransecure) | |
.InCaseOfException(MarkServiceAsDown) | |
.Return(TheResult, OrFailureCodeInCaseOfFailure); | |
} |
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
Looks interesting, was this just an example or is it a piece from running code?