public bool ObjectWordIndexDelete(SearchObjectWord w)
        {
            var d = (from wd in objectWords
                     where wd.SearchObjectId == w.SearchObjectId &&
                     wd.WordId == w.WordId
                     select wd).FirstOrDefault();

            if (d != null)
            {
                objectWords.Remove(d);
            }

            return(true);
        }
Beispiel #2
0
        public bool ObjectWordIndexInsert(SearchObjectWord w)
        {
            using (var context = CreateHccDbContext())
            {
                var word = new hcc_SearchObjectWord();
                word.Score          = w.Score;
                word.SearchObjectId = w.SearchObjectId;
                word.WordId         = w.WordId;
                word.SiteId         = w.SiteId;

                context.hcc_SearchObjectWords.Add(word);
                context.SaveChanges();
                return(true);
            }
        }
Beispiel #3
0
        public bool ObjectWordIndexDelete(SearchObjectWord word)
        {
            using (var context = CreateHccDbContext())
            {
                var s = context.hcc_SearchObjectWords
                        .Where(w => w.SearchObjectId == word.SearchObjectId && w.WordId == word.WordId)
                        .FirstOrDefault();

                if (s != null)
                {
                    context.hcc_SearchObjectWords.Remove(s);
                    context.SaveChanges();
                    return(true);
                }
                return(false);
            }
        }
 public bool ObjectWordIndexInsert(SearchObjectWord w)
 {
     objectWords.Add(w);
     return(true);
 }
 public bool ObjectWordIndexInsert(SearchObjectWord w)
 {
     return(provider.ObjectWordIndexInsert(w));
 }