コード例 #1
0
        private IEnumerable <string> insertTags(IEnumerable <string> tags)
        {
            IEnumerable <string> newtags = null;

            using (FileDataModelContainer db = new FileDataModelContainer()) {
                var query = from c in db.TagTable
                            //where !tags.Contains(c.tag)
                            select c.tag;
                newtags = tags.Except(query).ToList();
                foreach (string t in newtags)
                {
                    TagTable tabtable = new TagTable();
                    tabtable.tag = t;
                    db.AddToTagTable(tabtable);
                }
                db.SaveChanges();
            }
            return(newtags);
        }
コード例 #2
0
ファイル: MainForm.Query.cs プロジェクト: mohammadul/addondev
        private IEnumerable<string> insertTags(IEnumerable<string> tags)
        {
            IEnumerable<string> newtags = null;
            using (FileDataModelContainer db = new FileDataModelContainer()) {

                var query = from c in db.TagTable
                            //where !tags.Contains(c.tag)
                            select c.tag;
                newtags = tags.Except(query).ToList();
                foreach(string t in newtags){
                    TagTable tabtable = new TagTable();
                    tabtable.tag = t;
                    db.AddToTagTable(tabtable);
               }
                db.SaveChanges();
            }
            return newtags;
        }