예제 #1
0
        public async Task Handle(IdeaCommentCreatedEvent message)
        {
            var idea = await GetIdea(message.Comment.IdeaId);

            if (idea == null)
            {
                return;
            }

            await _repository.AddAsync(new Activity
            {
                Type        = Activity.IDEAS_COMMENTS_CREATE,
                Body        = message.Comment.Content,
                OwnerId     = _userIdentityProvider.GetUserId(),
                CreatedAt   = DateTime.UtcNow,
                ItemId      = message.Comment.Id,
                ItemOwnerId = message.Comment.OwnerId,
                IdeaId      = message.Comment.IdeaId,
                IdeaOwnerId = idea.OwnerId,
                ItemDetails = new ActivityItemDetails()
            });
        }
 public async Task Handle(IdeaCommentCreatedEvent message)
 {
     await UpdateIdeaStats(message.Comment.IdeaId);
 }