public DevloperAggregate(Developer cc) { var c = new DevloperSubmitedEvent (cc.UniqueId, cc.Name); this.Key = c.UniqueId.GetAggregateKey(); ApplyChange(c); }
private void Apply(DevloperSubmitedEvent e) { Status = DeveloperStatus.New; Name = e.Name; UniqueId = e.UniqueId; Version = e.Version++; this.Key = e.UniqueId.GetAggregateKey(); }
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 }); } }