Ejemplo n.º 1
0
 public TagModel(Tag t)
 {
     this.tag = t.TagName;
     this.tagId = t.Tag_ID;
 }
Ejemplo n.º 2
0
        public static List<Tag> insertTags(List<TagModel> tags)
        {
            if (tags != null)
            {

                List<Tag> tList = new List<Tag>();
                List<Tag> insertedTagList = new List<Tag>();

                foreach (TagModel tm in tags)
                {
                    Tag ext = (from t in _db.Tags
                               where t.TagName == tm.Tag
                               select t).SingleOrDefault();

                    if (ext == null)
                    {
                        ext = new Tag();
                        ext.TagName = tm.Tag;

                        tList.Add(ext);
                    }

                    insertedTagList.Add(ext);
                }
                _db.Tags.InsertAllOnSubmit(tList);
                _db.SubmitChanges();

                return insertedTagList;
            }
            return null;
        }
Ejemplo n.º 3
0
 partial void UpdateTag(Tag instance);
Ejemplo n.º 4
0
 partial void DeleteTag(Tag instance);
Ejemplo n.º 5
0
 partial void InsertTag(Tag instance);