Skip to content

Instantly share code, notes, and snippets.

@avegaraju
Created September 24, 2018 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avegaraju/eef9b73057ef1a9cdfc9708dfbf9ae5f to your computer and use it in GitHub Desktop.
Save avegaraju/eef9b73057ef1a9cdfc9708dfbf9ae5f to your computer and use it in GitHub Desktop.
private Result<Unit> ApplyDiscountWhenAvailable(Option<string> discountCode)
{
return discountCode.Match(Some: ApplyDiscount,
None: () => Unit.Default);
}
private Result<Unit> ApplyDiscount(string discountCode)
{
//mimic applying discount code (whatever that means)
return Unit.Default;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment