Exemplo n.º 1
0
        public RoastSchedule(Guid id, DateTime roastWeekStartsOn)
        {
            RoastDays = new RoastDays(new HashSet <RoastDay>());

            //不仅把event放到集合中,还调用本类的Apply方法
            ApplyChange(new RoastScheduleCreatedEvent(id, roastWeekStartsOn));
        }
Exemplo n.º 2
0
        public void SetRoastDays(RoastDays roastDays)
        {
            if (roastDays.Days.Count == 0)
            {
                throw new ArgumentNullException("roastDays count must be greater than 0");
            }
            var newDays = roastDays.Days.Select(t => t.Day).ToArray();

            ApplyChange(new RoastScheduleRoastDayChosenEvent(Id, newDays));
        }
Exemplo n.º 3
0
 //
 public void Apply(RoastScheduleRoastDayChosenEvent e)
 {
     RoastDays = new RoastDays(e.Days);
 }