예제 #1
0
        public void DeleteRelation(Post post, Term term)
        {
            TermRelation relation = db.TermRelations.Where(tr => tr.PostID == post.PostID && tr.TermID == term.TermID).Single();

            db.TermRelations.Remove(relation);

            db.SaveChanges();
        }
예제 #2
0
        public void AddRelation(Post post, Term[] terms)
        {
            foreach (Term term in terms)
            {
                TermRelation relation = new TermRelation();

                relation.PostID = post.PostID;
                relation.TermID = term.TermID;

                db.TermRelations.Add(relation);

                db.SaveChanges();
            }
        }
예제 #3
0
파일: PredLogic.cs 프로젝트: pedroos/limits
 public TermPair(Term term1, Term term2, TermRelation relation) // Problem: TermPair too different from TermSet
 {
     Term1    = term1;
     Term2    = term2;
     Relation = relation;
 }