示例#1
0
 private void Apply(LaneCreatedEvent obj)
 {
     this.AggregateId     = obj.AggregateId;
     this.Name            = obj.Name;
     this.ColorCode       = obj.ColorCode;
     this.RunningNumberId = obj.RunningNumberId;
     this.Tasks           = new List <Guid>();
 }
示例#2
0
        private LaneAggregateRoot(Guid laneId, Guid runningNumberId, string name, string colorCode,
                                  bool isCompletedLane, bool isRejectedLane) : this()
        {
            if (!this.ValidateColorCode(colorCode))
            {
                throw new InvalidColorCodeGivenException(colorCode);
            }


            var creationEvent =
                new LaneCreatedEvent(laneId, runningNumberId, name, colorCode, isCompletedLane, isRejectedLane);

            this.RaiseEvent(creationEvent);
        }