Inheritance: IClientState
        public void Save(Client client)
        {
            IEnumerable<IDomainEvent> changes = ((IAggregate)client).GetChanges();
            Guid id = ((IHaveIdentity)client.Identity).GetSurrogateId();
            IEventStream eventStream = eventStore.OpenStream(id);

            foreach (var domainEvent in changes)
            {
                if (eventStream.StreamRevision != (domainEvent.Version - 1))
                {
                    throw new Exception(
                        String.Format("Concurrency violation. Expected stream revision {0}, but actual revision was {1}",
                        (domainEvent.Version - 1), eventStream.StreamRevision));
                }

                eventStream.Add(new EventMessage(domainEvent));
                eventPublisher.Publish(domainEvent);
            }
        }
 public void Save(Client client)
 {
     IMemento memento = ((IAggregate)client).GetSnapshot();
     documentStore.Save(memento.Identity.GetSurrogateId(), memento);
 }