1.修改数据库连接
"Default": "server=host;port=5236;user id=ABP;password=1q2w3E*;database=ABP",
建议用户名和数据库一样,后期便于处理
2,添加达梦的ef库,sdk
<PackageReference Include="DM.Microsoft.EntityFrameworkCore" Version="3.1.0.20604" />
3,修改引用的地方,使用达梦数据库
XXXXHttpApiHostModule
Configure<AbpDbContextOptions>(options =>
{
options.Configure(ctx =>
{
if (ctx.ExistingConnection != null)
{
ctx.DbContextOptions.UseDm(ctx.ExistingConnection);
}
else
{
ctx.DbContextOptions.UseDm(ctx.ConnectionString);
}
});
});
XXXXHttpApiHostMigrationsDbContextFactory
var builder = new DbContextOptionsBuilder<XXXXHttpApiHostMigrationsDbContext>()
.UseDm(configuration.GetConnectionString(XXXX"));
标签:ExistingConnection,Configure,数据库,ctx,abp,UseDm,达梦
From: https://www.cnblogs.com/drivertobolin/p/18285406