【发布时间】:2020-03-09 23:41:36
【问题描述】:
我有一个将数据从 MySql 数据库同步到 SQL Server 数据库的应用程序。
考虑这两个 DbContext 服务:
services.AddDbContext<SqlServerContext>(options => options
.UseSqlServer(Configuration.GetConnectionString("SqlServer")));
services.AddDbContext<MySqlContext>(options => options
.UseMySql(Configuration.GetConnectionString("MySql"))
.AddInterceptors(new MySqlInterceptor()));
在MySqlInterceptor();我想注入/解析/使用Service 甚至SqlServerContext,以便获得修改CommandText 的配置。
有什么想法吗?
【问题讨论】:
标签: c# ef-core-3.0