File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ public Startup(IWebHostEnvironment env)
5151
5252 public void ConfigureServices ( IServiceCollection services )
5353 {
54+ //数据库
55+ services . AddDb ( _env , _appConfig ) ;
56+
5457 //应用配置
5558 services . AddSingleton ( _appConfig ) ;
5659
@@ -195,9 +198,6 @@ public void ConfigureServices(IServiceCollection services)
195198 } ) ;
196199 #endregion
197200
198- //数据库
199- services . AddDb ( _env , _appConfig ) ;
200-
201201 #region 缓存
202202 var cacheConfig = new ConfigHelper ( ) . Get < CacheConfig > ( "cacheconfig" , _env . EnvironmentName ) ;
203203 if ( cacheConfig . Type == CacheType . Redis )
Original file line number Diff line number Diff line change 1818 //建库连接字符串
1919 //MySql "Server=localhost; Port=3306; Database=mysql; Uid=root; Pwd=pwd; Charset=utf8mb4;"
2020 //SqlServer "Data Source=.;Integrated Security=True;Initial Catalog=master;Pooling=true;Min Pool Size=1"
21+ //PostgreSQL "CREATE DATABASE \"admindb\" WITH ENCODING = 'UTF8'"
2122 "createDbConnectionString" : " Server=localhost; Port=3306; Database=mysql; Uid=root; Pwd=pwd; Charset=utf8mb4;" ,
2223 //建库脚本
2324 //MySql "CREATE DATABASE `admindb` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'"
3132 //MySql "Server=localhost; Port=3306; Database=admindb; Uid=root; Pwd=pwd; Charset=utf8mb4;"
3233 //SqlServer "Data Source=.;Integrated Security=True;Initial Catalog=admindb;Pooling=true;Min Pool Size=1"
3334 //Sqlite "Data Source=|DataDirectory|\\admindb.db; Pooling=true;Min Pool Size=1"
35+ //PostgreSQL "Host=localhost;Port=5432;Username=postgres;Password=; Database=admindb;Pooling=true;Minimum Pool Size=1"
3436 "connectionString" : " Data Source=|DataDirectory|\\ admindb.db; Pooling=true;Min Pool Size=1"
3537}
You can’t perform that action at this time.
0 commit comments