Пример #1
0
        public virtual IProductCategoryMemberEvent GetEvent(ProductCategoryMemberId productCategoryMemberId, long version)
        {
            var e = (IProductCategoryMemberEvent)EventStore.GetEvent(ToEventStoreAggregateId(productCategoryMemberId), version);

            if (e != null)
            {
                e.ReadOnly = true;
            }
            else if (version == -1)
            {
                return(GetEvent(productCategoryMemberId, 0));
            }
            return(e);
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            ProductCategoryMemberId other = obj as ProductCategoryMemberId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.ProductCategoryId, other.ProductCategoryId) &&
                   Object.Equals(this.ProductId, other.ProductId)
                   );
        }
Пример #3
0
 public ProductCategoryMemberEventId(ProductCategoryMemberId productCategoryMemberId, long version)
 {
     this._productCategoryMemberId = productCategoryMemberId;
     this._version = version;
 }
Пример #4
0
 public abstract IEventStoreAggregateId ToEventStoreAggregateId(ProductCategoryMemberId aggregateId);
Пример #5
0
        public virtual IProductCategoryMemberState GetHistoryState(ProductCategoryMemberId productCategoryMemberId, long version)
        {
            var eventStream = EventStore.LoadEventStream(typeof(IProductCategoryMemberEvent), ToEventStoreAggregateId(productCategoryMemberId), version - 1);

            return(new ProductCategoryMemberState(eventStream.Events));
        }
Пример #6
0
        public virtual IProductCategoryMemberState Get(ProductCategoryMemberId productCategoryMemberId)
        {
            var state = StateRepository.Get(productCategoryMemberId, true);

            return(state);
        }