Esempio n. 1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="WhereLambda">删除条件的lambda的表达式</param>
        /// <returns>符合此lambda的集合</returns>
        public int Delete(Expression <Func <TModel, bool> > WhereLambda)
        {
            //DbContextEnity.SaveChanges();
            int Count = CurrentDal.Delete(WhereLambda);

            DbContextEnity.SaveChanges();
            return(Count);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一个实体
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Update(TModel model)
 {
     try
     {
         CurrentDal.Update(model);
         DbContextEnity.SaveChanges();
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Esempio n. 3
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="model">添加的实体</param>
 public void Add(TModel model)
 {
     CurrentDal.Add(model);
     DbContextEnity.SaveChanges();
 }