Beispiel #1
0
        public void SaveKeywords(string needSaveKeyword)
        {
            IList <Keyword> keywords = new Keyword().GetKeyWordslist(needSaveKeyword);

            foreach (var item in keywords)
            {
                keywordEntity = keywordRepository.GetByKeyword(item);
                if (keywordEntity == null)
                {
                    keywordEntity = new Keyword().AddNewKeyword(item);
                    keywordRepository.Save(keywordEntity);
                }
                else
                {
                    keywordEntity = keywordEntity.AddUsed(item);
                    keywordRepository.UpdateKeywordUsed(keywordEntity);
                }
            }
        }