/// <summary>
        /// 添加考试班级
        /// </summary>
        /// <param name="clsTest">考试班级</param>
        /// <returns></returns>
        public bool AddClassTest(ClassTests clsTest)
        {
            _db.ClassTests.Add(clsTest);
            var result = _db.SaveChanges();

            return(result > 0);
        }
        /// <summary>
        /// 修改考试班级
        /// </summary>
        /// <param name="clsTest">考试班级</param>
        /// <returns></returns>
        public bool ModifyClassTest(ClassTests clsTest)
        {
            var oldClsTest = _db.ClassTests.Find(clsTest.Id);

            if (oldClsTest == null)
            {
                throw new Exception($"查询不到ID为{clsTest.Id}的考试班级");
            }
            else
            {
                oldClsTest.TestId     = clsTest.TestId;
                oldClsTest.ClassId    = clsTest.ClassId;
                oldClsTest.IsValidate = clsTest.IsValidate;

                var result = _db.SaveChanges();
                return(result > 0);
            }
        }