.net core 資料庫屬性設定(appsettings)
在Startup.cs中HostingConnection屬性
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("HostingConnection")));
可以由
.\appsettings.json 裡設定
"ConnectionStrings": {
"DefaultConnection": "XXX",
"HostingConnection": "XXX"
},
沒有留言:
張貼留言