public void DeleteProblemTag(ProblemTag ProblemTag) { context.Entry(ProblemTag).State = EntityState.Deleted; context.SaveChanges(); return; }
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; }