コード例 #1
0
 private void OnAuctionCreated(AuctionCreated auctionCreated)
 {
     Id = auctionCreated.AuctionId;
     Item = auctionCreated.Item;
     MinimumPrice = auctionCreated.MinimumPrice;
     Created = auctionCreated.Time;
     CreatedBy = auctionCreated.UserId;
 }
コード例 #2
0
        public Auction(Item item, Guid userId, uint minimumPrice)
            : this()
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            if (userId == Guid.Empty)
            {
                throw new ArgumentNullException("userId");
            }

            var createdEvent = new AuctionCreated()
            {
                AuctionId = Guid.NewGuid(),
                Time = DateTime.Now,
                Item = item,
                MinimumPrice = minimumPrice,
                UserId = userId
            };
            
            base.RaiseEvent(createdEvent);
        }