コード例 #1
0
        public static FruitAggregate CreateNew(string fruitId, decimal weight, FruitCondition condition, TypeOfFruit type)
        {
            var agg = new FruitAggregate();

            agg.Summon(fruitId, weight, condition, type);

            return(agg);
        }
コード例 #2
0
        public static FruitAggregate Replay(ICollection <IDomainEvent> events)
        {
            var agg = new FruitAggregate();

            foreach (var e in events)
            {
                agg.Apply((dynamic)e);
            }

            return(agg);
        }