public virtual IOrderShipmentEvent GetEvent(OrderShipmentId orderShipmentId, long version)
        {
            var e = (IOrderShipmentEvent)EventStore.GetEvent(ToEventStoreAggregateId(orderShipmentId), version);

            if (e != null)
            {
                e.ReadOnly = true;
            }
            else if (version == -1)
            {
                return(GetEvent(orderShipmentId, 0));
            }
            return(e);
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            OrderShipmentId other = obj as OrderShipmentId;

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

            return(true &&
                   Object.Equals(this.OrderId, other.OrderId) &&
                   Object.Equals(this.OrderItemSeqId, other.OrderItemSeqId) &&
                   Object.Equals(this.ShipGroupSeqId, other.ShipGroupSeqId) &&
                   Object.Equals(this.ShipmentId, other.ShipmentId) &&
                   Object.Equals(this.ShipmentItemSeqId, other.ShipmentItemSeqId)
                   );
        }
 public abstract IEventStoreAggregateId ToEventStoreAggregateId(OrderShipmentId aggregateId);
        public virtual IOrderShipmentState GetHistoryState(OrderShipmentId orderShipmentId, long version)
        {
            var eventStream = EventStore.LoadEventStream(typeof(IOrderShipmentEvent), ToEventStoreAggregateId(orderShipmentId), version - 1);

            return(new OrderShipmentState(eventStream.Events));
        }
        public virtual IOrderShipmentState Get(OrderShipmentId orderShipmentId)
        {
            var state = StateRepository.Get(orderShipmentId, true);

            return(state);
        }
Ejemplo n.º 6
0
 public OrderShipmentEventId(OrderShipmentId orderShipmentId, long version)
 {
     this._orderShipmentId = orderShipmentId;
     this._version         = version;
 }