Пример #1
0
        public BaseRespository()
        {
            DbContext db = EFFatory.GetEFContext();

            //关闭 EF容器的 为空检查
            db.Configuration.ValidateOnSaveEnabled = false;
            eFRepository = new EFRepository <TEntity>(db);
        }
Пример #2
0
 public int SaveChanges()
 {
     //从线程中获取EF容器对象
     return(EFFatory.GetEFContext().SaveChanges());
 }