Example #1
0
 public BaseRepository()
 {
     db = new SqlSugarClient(new ConnectionConfig()
     {
         //连接字符串
         ConnectionString      = Appsettings.Get("conStr"),
         DbType                = DbType.SqlServer, //sqlserver数据库枚举的类型
         IsAutoCloseConnection = true,             //自动关闭
         MoreSettings          = new ConnMoreSettings()
         {
             IsAutoRemoveDataCache = true //自动删除数据缓存
         }
     });
     entityDB = new SimpleClient <TEntity>(db);
 }