示例#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
 public TermPair(Term term1, Term term2, TermRelation relation) // Problem: TermPair too different from TermSet
 {
     Term1    = term1;
     Term2    = term2;
     Relation = relation;
 }