Exemplo n.º 1
0
        public virtual SellableInventoryItemEntryStateCreatedDto NewSellableInventoryItemEntryStateCreated(long entrySeqId)
        {
            var e   = new SellableInventoryItemEntryStateCreatedDto();
            var eId = NewSellableInventoryItemEntryEventId(entrySeqId);

            e.SellableInventoryItemEntryEventId = eId;
            return(e);
        }
        public virtual SellableInventoryItemEntryStateCreatedDto ToSellableInventoryItemEntryStateCreatedDto(ISellableInventoryItemEntryStateCreated e)
        {
            var dto = new SellableInventoryItemEntryStateCreatedDto();

            dto.SellableInventoryItemEntryEventId = e.SellableInventoryItemEntryEventId;
            dto.CreatedAt        = e.CreatedAt;
            dto.CreatedBy        = e.CreatedBy;
            dto.Version          = e.Version;
            dto.CommandId        = e.CommandId;
            dto.SellableQuantity = e.SellableQuantity;
            dto.SourceEventId    = e.SourceEventId;
            return(dto);
        }
        public virtual SellableInventoryItemStateCreatedDto ToSellableInventoryItemStateCreatedDto(ISellableInventoryItemStateCreated e)
        {
            var dto = new SellableInventoryItemStateCreatedDto();

            dto.SellableInventoryItemEventId = e.SellableInventoryItemEventId;
            dto.CreatedAt        = e.CreatedAt;
            dto.CreatedBy        = e.CreatedBy;
            dto.CommandId        = e.CommandId;
            dto.SellableQuantity = e.SellableQuantity;
            var sellableInventoryItemEntryEvents = new List <SellableInventoryItemEntryStateCreatedDto>();

            foreach (var ee in e.SellableInventoryItemEntryEvents)
            {
                SellableInventoryItemEntryStateCreatedDto eeDto = SellableInventoryItemEntryStateEventDtoConverter.ToSellableInventoryItemEntryStateCreatedDto(ee);
                sellableInventoryItemEntryEvents.Add(eeDto);
            }
            dto.SellableInventoryItemEntryEvents = sellableInventoryItemEntryEvents.ToArray();

            return(dto);
        }