Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created February 5, 2018 22:36
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 dcomartin/c0181e78f45c45f3819cf545b67ba8f7 to your computer and use it in GitHub Desktop.
Save dcomartin/c0181e78f45c45f3819cf545b67ba8f7 to your computer and use it in GitHub Desktop.
public class BankAccountState
{
public decimal Balance { get; set; }
public BankAccountState Apply(Deposited evnt)
{
Balance += evnt.Amount;
return this;
}
public BankAccountState Apply(Withdrawn evnt)
{
Balance -= evnt.Amount;
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment