コード例 #1
0
ファイル: InventoryWine.cs プロジェクト: spinakr/wineventory
        public void AddBottle(string vintage, int price)
        {
            var @event = new BottleOfWineAdded
            {
                Id           = Id,
                Vintage      = vintage,
                Price        = price,
                PurchaseDate = DateTime.Today
            };

            Apply(@event);
            Append(@event);
        }
コード例 #2
0
ファイル: InventoryWine.cs プロジェクト: spinakr/wineventory
 public void Apply(BottleOfWineAdded @event)
 {
     Bottles.Add(new Bottle(@event.PurchaseDate, @event.Price, @event.Vintage));
 }