public void Handle(ChangeAccountEmail command) { // Explicit var account = Repository.Load <Account>(command.Id); account.ChangeEmail(command.OldEmail, command.NewEmail); //Repository.Save(account); // OR // Implicit Update(command.Id, user => user.ChangeEmail(command.OldEmail, command.NewEmail)); }
public void Handle(ChangeAccountEmail command) { Update(command.Id, user => user.ChangeEmail(command.OldEmail, command.NewEmail)); }