Exemple #1
0
        public DevloperAggregate(Developer cc)
        {
            var c = new DevloperSubmitedEvent
                        (cc.UniqueId, cc.Name);

            this.Key = c.UniqueId.GetAggregateKey();
            ApplyChange(c);
        }
Exemple #2
0
        private void Apply(DevloperSubmitedEvent e)
        {
            Status = DeveloperStatus.New;

            Name     = e.Name;
            UniqueId = e.UniqueId;
            Version  = e.Version++;
            this.Key = e.UniqueId.GetAggregateKey();
        }
Exemple #3
0
        public override async Task <ExecutionStatus> HandleEvent(DomainEvent @event)
        {
            DevloperSubmitedEvent developerSubmitEvent = @event as DevloperSubmitedEvent;

            var cfs = _mapper.Map <Developer>(developerSubmitEvent);

            var execution = await
                            _ZEsDeveloperRepository.SubmitAsync(cfs);

            if (execution == null)
            {
                return new ExecutionStatus()
                       {
                           Success = false
                       }
            }
            ;

            return(new ExecutionStatus()
            {
                Success = true
            });
        }
    }