コード例 #1
0
        public void Apply(PortfolioCreatedEvent @event)
        {
            Version++;

            Name  = @event.Name;
            Owner = @event.Owner;
        }
コード例 #2
0
        public void Create(string name, Guid owner)
        {
            var @event = new PortfolioCreatedEvent(Id, Version, name, owner);

            Apply(@event);

            PublishEvent(@event);
        }