public bool DeleteByID(int id)
        {
            // 解除试题与题库之间的联系
            var tmp1 = db.include_question_between_bank_and_trueorfalse.Where(p => p.BankID == id);

            foreach (var i in tmp1)
            {
                db.include_question_between_bank_and_trueorfalse.Remove(i);
            }
            var tmp2 = db.include_question_between_bank_and_completion.Where(p => p.BankID == id);

            foreach (var i in tmp2)
            {
                db.include_question_between_bank_and_completion.Remove(i);
            }
            var tmp3 = db.include_question_between_bank_and_selection.Where(p => p.BankID == id);

            foreach (var i in tmp3)
            {
                db.include_question_between_bank_and_selection.Remove(i);
            }
            var tmp4 = db.include_question_between_bank_and_questionandanswer.Where(p => p.BankID == id);

            foreach (var i in tmp4)
            {
                db.include_question_between_bank_and_questionandanswer.Remove(i);
            }
            var tmp5 = db.include_question_between_bank_and_reading.Where(p => p.BankID == id);

            foreach (var i in tmp5)
            {
                db.include_question_between_bank_and_reading.Remove(i);
            }
            var tmp6 = db.include_question_between_bank_and_composition.Where(p => p.BankID == id);

            foreach (var i in tmp6)
            {
                db.include_question_between_bank_and_composition.Remove(i);
            }
            // 删除题库
            questionbank qb = db.questionbank.Where(p => p.ID == id).FirstOrDefault();

            if (qb != null)
            {
                db.questionbank.Remove(qb);
                db.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool UpdateByID(int id, questionbank qb)
        {
            questionbank tmp = db.questionbank.Where(p => p.ID == id).FirstOrDefault();

            if (tmp != null)
            {
                tmp.BankName = qb.BankName;
                db.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public questionbank Add(questionbank qb)
 {
     qb = db.questionbank.Add(qb);
     db.SaveChanges();
     return(qb);
 }