//在Program.cs中写:
//Dapper可以写一设计数据库表的名字
builder.Services.AddDbContext<MyDbcontext>(a => a.UseSqlServer(builder.Configuration.GetConnectionString("Dapper")));
//在appsettings.json里面写:
//Dapper要跟上面的保持一致
"ConnectionStrings": {
"Db": "server=.;uid=sa;pwd=123456;database=Dapper;"
},
//迁移的命令是:
// 1 可以说明迁移的事件
add-migration 1
update-database
标签:database,builder,Dapper,命令,net,迁移 From: https://www.cnblogs.com/qibaidao/p/17588945.html