Ejemplo n.º 1
0
        public Task Handle(UpdateIdeaCommand message)
        {
            var ideaTobeUpdated = _dataMapper.Map <Idea>(message.Idea);

            var existing = _repository.GetOne <Idea>(message.Idea.Id);


            existing.Title              = ideaTobeUpdated.Title;
            existing.Description        = ideaTobeUpdated.Description;
            existing.IsFundingRequired  = ideaTobeUpdated.IsFundingRequired;
            existing.FundingRequirement = ideaTobeUpdated.FundingRequirement;

            existing.ModifiedAt     = DateTime.UtcNow;
            existing.LastModifiedBy = _userIdentityProvider.GetUserId();

            var result = _repository.Update(existing);

            return(_bus.RaiseEvent(new IdeaUpdatedEvent(_dataMapper.Map <IdeaDto>(result))));
        }
Ejemplo n.º 2
0
        public Task UpdateAsync(IdeaDto idea)
        {
            var command = new UpdateIdeaCommand(idea);

            return(_bus.SendCommand(command));
        }