コード例 #1
0
        private async Task PublishOnSocialMediaAsync(Guid remarkId, string culture, IList <SocialMedia> socialMedia)
        {
            if (socialMedia == null || !socialMedia.Any())
            {
                Logger.Debug($"Remark with id: '{remarkId}' will not be published on social media.");

                return;
            }

            Logger.Debug($"Remark with id: '{remarkId}' will be published on social media.");
            var userSocialMedia = socialMedia
                                  .Where(x => x.Name.NotEmpty() && x.Publish)
                                  .Select(x => Domain.UserSocialMedia.Create(x.Name, x.AccessToken))
                                  .ToArray();

            await _socialMediaService.PublishRemarkCreatedAsync(remarkId, culture, userSocialMedia);
        }