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