Beispiel #1
0
        public void Register(string id, string password)
        {
            if (Version > 0)
            {
                throw new InvalidOperationException($"Account with username {id} already exists.");
            }

            var buddyId = Guid.NewGuid().ToString();
            var e       = new AccountRegistered(id, password, buddyId);

            Publish(e);
        }
Beispiel #2
0
 private void When(AccountRegistered e)
 {
     Id = e.Id;
 }