示例#1
0
 public bool SaveTag(BlogTagItem tag)
 {
     try
     {
         var currentTags = LoadTag(tag);
         if (currentTags == null)
         {
             currentTags = tag;
         }
         else
         {
             currentTags.TagName     = tag.TagName;
             currentTags.Count       = tag.Count;
             currentTags.Weight      = tag.Weight;
             currentTags.DisplayName = tag.DisplayName;
         }
         Store.Save(currentTags);
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
示例#2
0
 public BlogTagItem LoadTag(BlogTagItem tag) => LoadTags().FirstOrDefault(x => x.TagName == tag.TagName);
示例#3
0
        public void IncreaseTagCount(BlogTagItem tag)
        {
            tag.Count++;

            SaveTag(tag);
        }