Пример #1
0
 public Term CreateTerm(Term term)
 {
     using (var db = new SearchEngineEntities())
     {
         db.Terms.Add(term);
         db.SaveChanges();
         return term;
     }
 }
Пример #2
0
 public bool UpdateTerm(Term term)
 {
     using (var db = new SearchEngineEntities())
     {
         if (term == null)
         {
             throw new ArgumentNullException("item");
         }
         Term termBeingUpdated = db.Terms.Single(e => e.ID == term.ID);
         termBeingUpdated.value = term.value;
         db.SaveChanges();
         return true;
     }
 }