コード例 #1
0
        public async Task <Like> AddLikeAsync(User user, Announcement announcement)
        {
            Like like = new Like
            {
                User         = user,
                Announcement = announcement
            };

            await likeRepository.AddLikeAsync(like);

            await interactionService.AddInteractionAsync(user, announcement, Interaction.InteractionType.LIKE);

            await unitOfWork.CompleteAsync();

            return(like);
        }