Beispiel #1
0
        public async Task Handle(AddReactionCommand notification, CancellationToken cancellationToken)
        {
            var reaction = new Reaction
            {
                Type        = notification.Reaction,
                PostUuid    = notification.ReactedObjectType == ReactedObjectType.Post ? notification.ObjectUuid : null,
                CommentUuid = notification.ReactedObjectType == ReactedObjectType.Comment ? notification.ObjectUuid : null,
                CreatedDate = DateTime.Now,
                UserUuid    = notification.UserUuid
            };

            await _repo.AddOrUpdateReaction(reaction);
        }