Exemple #1
0
 void Book(MakeTransfer transfer)
 => accounts.Get(transfer.DebitedAccountId)
 .Bind(account => account.Debit(transfer.Amount))
 .ForEach(newState =>
 {
     accounts.Save(transfer.DebitedAccountId, newState);
     swift.Wire(transfer, newState);
 });
Exemple #2
0
 MakeTransfer Normalize(MakeTransfer request)
 => request;    // remove whitespace, toUpper, etc.
Exemple #3
0
 public void MakeTransfer(MakeTransfer transfer)
 => Some(transfer)
 .Map(Normalize)
 .Where(validator.IsValid)
 .ForEach(Book);