예제 #1
0
        public void DeleteProblemTag(ProblemTag ProblemTag)
        {
            context.Entry(ProblemTag).State = EntityState.Deleted;

            context.SaveChanges();

            return;
        }
예제 #2
0
        public int AddProblemTag(ProblemTag ProblemTag)
        {
            if (ProblemTag.ProblemTagID == 0)
            {
                ProblemTag = context.ProblemTags.Add(ProblemTag);
            }
            else
            {
                context.Entry(ProblemTag).State = EntityState.Modified;
            }
            context.SaveChanges();
            context.Entry(ProblemTag).Reload();

            return ProblemTag.ProblemTagID;
        }