public static FruitAggregate CreateNew(string fruitId, decimal weight, FruitCondition condition, TypeOfFruit type) { var agg = new FruitAggregate(); agg.Summon(fruitId, weight, condition, type); return(agg); }
public static FruitAggregate Replay(ICollection <IDomainEvent> events) { var agg = new FruitAggregate(); foreach (var e in events) { agg.Apply((dynamic)e); } return(agg); }