Esempio n. 1
0
 public IEnumerable <ValidationMessage> Requires(AccountCommand command)
 {
     if (string.IsNullOrWhiteSpace(command.AccountId))
     {
         yield return(ValidationMessage.Error("Account id cannot be empty", nameof(command.AccountId)));
     }
 }
Esempio n. 2
0
 public IEnumerable <ValidationMessage> Requires(AccountCommand command, AccountState before)
 {
     if (command.AccountId != before.AccountId)
     {
         yield return(ValidationMessage.Error("This is not the right account", nameof(command.AccountId), nameof(before.AccountId)));
     }
 }