public User(Guid id, string name, string email, string provider, string providerKey) { RegisterEvents(); var @event = new ExternalUserCreatedEvent(id, name, email, provider, providerKey); RaiseEvent(@event); }
void OnExternalCreated(ExternalUserCreatedEvent @event) { Id = @event.Id; Name = @event.Name; Email = @event.Email; var account = new Account(@event.Provider, @event.ProviderKey); Accounts.Add(account); }