小编tun*_*uno的帖子

.NET核心DbContext动态连接字符串

我试图根据每个http请求标头设置我的DbContext的连接字符串.是否有可能在.NET Core中这样做?我在MVC5中做到了,但我无法在.NET核心中实现它.

public void ConfigureServices(IServiceCollection services)
{
    // ...
}
Run Code Online (Sandbox Code Playgroud)

我不知道http标头,所以我在哪里可以做到?

.net c# asp.net-mvc entity-framework .net-core

5
推荐指数
2
解决办法
2174
查看次数

标签 统计

.net ×1

.net-core ×1

asp.net-mvc ×1

c# ×1

entity-framework ×1