Example #1
0
        private SellableInventoryItemEntryEventId NewSellableInventoryItemEntryEventId(long entrySeqId)
        {
            var eId = new SellableInventoryItemEntryEventId();

            eId.SellableInventoryItemId = this.SellableInventoryItemEventId.SellableInventoryItemId;
            eId.EntrySeqId = entrySeqId;
            eId.SellableInventoryItemVersion = this.SellableInventoryItemEventId.Version;
            return(eId);
        }
        protected virtual ISellableInventoryItemEntryStateCreated MapCreate(ICreateSellableInventoryItemEntry c, ISellableInventoryItemCommand outerCommand, long version, ISellableInventoryItemState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new SellableInventoryItemEntryEventId(c.SellableInventoryItemId, c.EntrySeqId, version);
            ISellableInventoryItemEntryStateCreated e = NewSellableInventoryItemEntryStateCreated(stateEventId);
            var s = outerState.Entries.Get(c.EntrySeqId, true);

            e.SellableQuantity = c.SellableQuantity;
            e.SourceEventId    = c.SourceEventId;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(ICreate... ////////////////////////////
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            SellableInventoryItemEntryEventId other = obj as SellableInventoryItemEntryEventId;

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

            return(true &&
                   Object.Equals(this.SellableInventoryItemId, other.SellableInventoryItemId) &&
                   Object.Equals(this.EntrySeqId, other.EntrySeqId) &&
                   Object.Equals(this.SellableInventoryItemVersion, other.SellableInventoryItemVersion)
                   );
        }
 protected SellableInventoryItemEntryStateEventDtoBase(SellableInventoryItemEntryEventId stateEventId)
 {
     this.SellableInventoryItemEntryEventId = stateEventId;
 }
 public SellableInventoryItemEntryStateCreated(SellableInventoryItemEntryEventId stateEventId) : base(stateEventId)
 {
 }
 protected SellableInventoryItemEntryStateEventBase(SellableInventoryItemEntryEventId stateEventId) : base(stateEventId)
 {
 }
 protected SellableInventoryItemEntryEventBase(SellableInventoryItemEntryEventId stateEventId) : this(new SellableInventoryItemEntryState())
 {
     this.SellableInventoryItemEntryEventId = stateEventId;
 }
 private SellableInventoryItemEntryStateCreated NewSellableInventoryItemEntryStateCreated(SellableInventoryItemEntryEventId stateEventId)
 {
     return(new SellableInventoryItemEntryStateCreated(stateEventId));
 }
Example #9
0
        protected SellableInventoryItemEntryEventId NewSellableInventoryItemEntryEventId(long entrySeqId)
        {
            var stateEventId = new SellableInventoryItemEntryEventId(this.SellableInventoryItemEventId.SellableInventoryItemId, entrySeqId, this.SellableInventoryItemEventId.Version);

            return(stateEventId);
        }