コード例 #1
0
        public IEnumerable Handle(CreateSchedule command)
        {
            // TODO: Do we allow multiple schedules for
            var agRoot = ScheduleFactory.CreateSchedule(command);

            DomainRepository.AddSchedule(agRoot);

            return(new object[] { ScheduleFactory.EventFactory.ScheduleCreated(agRoot) });
            // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // NOTE: Don't use yield return, as it can cause silent failures in execution
            //yield return ScheduleFactory.EventFactory.ScheduleCreated(agRoot);
        }