private async Task MatchLinkerTags(SharelinkTagService tagService, ShareThing newShare, List<ShareThingMail> mails, IEnumerable<SharelinkTag> newShareTags)
 {
     var userService = this.UseSharelinkerService().GetSharelinkerService();
     var linkers = await userService.GetUserlinksOfUserId(UserSessionData.UserId);
     var linkerIds = from l in linkers select l.SlaveUserObjectId;
     var linkersTags = await tagService.GetLinkersTags(linkerIds);
     foreach (var linkerTags in linkersTags)
     {
         var sendMailFlag = false;
         var mail = new ShareThingMail()
         {
             ShareId = newShare.Id,
             Time = DateTime.UtcNow
         };
         if (linkerTags.Key != newShare.UserId)
         {
             var linkTagDatas = from lt in linkerTags.Value select lt;
             var matchTags = tagService.MatchTags(newShareTags, linkTagDatas);
             if (matchTags.Count() > 0)
             {
                 mail.Tags = matchTags;
                 sendMailFlag = true;
                 mail.ToSharelinker = linkerTags.Key;
             }
         }
         if (sendMailFlag)
         {
             mails.Add(mail);
         }
     }
 }
        private async Task SendShowToLinkerTagMessage(ShareService shareService, SharelinkerService userService, ObjectId userId, SharelinkTag newTag)
        {
            var newShare = new ShareThing()
            {
                ShareTime = DateTime.UtcNow,
                ShareType = newTag.IsFocus ? ShareThingConstants.SHARE_TYPE_MESSAGE_FOCUS_TAG : ShareThingConstants.SHARE_TYPE_MESSAGE_ADD_TAG,
                UserId = userId,
                ShareContent = SharelinkTagToResultObject(newTag.Id.ToString(),newTag).ToJson()
            };
            await shareService.PostNewShareThing(newShare);

            var linkers = await userService.GetUserlinksOfUserId(UserSessionData.UserId);
            var linkerIds = from l in linkers select l.SlaveUserObjectId;

            var newMails = new List<ShareThingMail>();
            foreach (var linker in linkerIds)
            {
                if (!Startup.SharelinkCenterList.Contains(linker.ToString()))
                {
                    var newMail = new ShareThingMail()
                    {
                        ShareId = newShare.Id,
                        Time = DateTime.UtcNow,
                        ToSharelinker = linker
                    };
                    newMails.Add(newMail);
                }
            }
            shareService.InsertMails(newMails);

            Startup.ServicesProvider.GetBahamutPubSubService().PublishShareMessages(newMails);
        }