예제 #1
0
        private void GetTags(string tags, Tweet tweet)
        {
            var allTags = tags.Split(' ');

            foreach (var item in allTags)
            {
                var newTag = new Tag();

                var founTag = this.tagServices.FindByName(item);

                if (founTag == null)
                {
                    newTag.Name = item;
                    newTag.IsVisible = true;
                }
                else
                {
                    newTag = founTag;
                    newTag.IsVisible = true;
                }

                tweet.Tags.Add(newTag);
            }
        }
예제 #2
0
 public void Add(Tag tag)
 {
     this.tags.Add(tag);
     this.tags.SaveChanges();
 }