コード例 #1
0
        public virtual ISupplierProductEvent GetEvent(SupplierProductId supplierProductId, long version)
        {
            var e = (ISupplierProductEvent)EventStore.GetEvent(ToEventStoreAggregateId(supplierProductId), version);

            if (e != null)
            {
                e.ReadOnly = true;
            }
            else if (version == -1)
            {
                return(GetEvent(supplierProductId, 0));
            }
            return(e);
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            SupplierProductId other = obj as SupplierProductId;

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

            return(true &&
                   Object.Equals(this.ProductId, other.ProductId) &&
                   Object.Equals(this.PartyId, other.PartyId) &&
                   Object.Equals(this.CurrencyUomId, other.CurrencyUomId) &&
                   Object.Equals(this.MinimumOrderQuantity, other.MinimumOrderQuantity)
                   );
        }
コード例 #3
0
 public abstract IEventStoreAggregateId ToEventStoreAggregateId(SupplierProductId aggregateId);
コード例 #4
0
        public virtual ISupplierProductState GetHistoryState(SupplierProductId supplierProductId, long version)
        {
            var eventStream = EventStore.LoadEventStream(typeof(ISupplierProductEvent), ToEventStoreAggregateId(supplierProductId), version - 1);

            return(new SupplierProductState(eventStream.Events));
        }
コード例 #5
0
        public virtual ISupplierProductState Get(SupplierProductId supplierProductId)
        {
            var state = StateRepository.Get(supplierProductId, true);

            return(state);
        }
コード例 #6
0
 public SupplierProductEventId(SupplierProductId supplierProductId, long version)
 {
     this._supplierProductId = supplierProductId;
     this._version           = version;
 }