csharp的efcore命令
约 74 字 预计阅读 1 分钟
这里记录 csharp 的 efcore 命令.
配置文件 appsettings.json
1
2
3
4
5
6
7
8
9
10
11
| {
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"BloggingDatabase": "Data Source=your_server_ip;Database=your_database_name;User ID=your_username;Min Pool Size=10;Password=your_password;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
}
}
|
注入依赖
1
2
3
4
5
| services.AddDbContextPool<BloggingContext>(
options =>{
options.UseSqlServer(Configuration.GetConnectionString("BloggingDatabase")); }
,poolSize:64
);
|