예제 #1
0
        /// <summary>
        /// 数据库修改
        /// </summary>
        /// <param name="model"></param>
        /// <param name="proNames"></param>
        /// <returns></returns>
        public int questionclassModify(QuestionClass_T model, params string[] proNames)
        {
            DbEntityEntry entry = db.Entry <QuestionClass_T>(model);

            entry.State = EntityState.Unchanged;
            foreach (string proName in proNames)
            {
                entry.Property(proName).IsModified = true;
            }
            return(db.SaveChanges());
        }
예제 #2
0
 /// <summary>
 /// 数据库增加
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int questionclassAdd(QuestionClass_T model)
 {
     db.QuestionClass_T.Add(model);
     return(db.SaveChanges());
 }