【发布时间】:2019-01-22 00:05:14
【问题描述】:
我有一个 webapi,我在 startup.cs 文件中使用 app.CreatePerOwinContext,但我想将该 webapi 迁移到 .net core 2.1。所以我一直坚持这一点,因为我无法为 CreatePerOwinContext 提供任何替代方案。
这是我的 webapi 代码:
public static UserManager<IdentityUser> Create(IdentityFactoryOptions<UserManager<IdentityUser>> options, IOwinContext context)
{
var manager = new UserManager<IdentityUser>(new UserStore());
return manager;
}
public void ConfigureAuth(IAppBuilder app)
{
app.CreatePerOwinContext<UserManager<IdentityUser>>(Create);
...
}
那么如何在 .net core 2.1 中转换上面的代码呢?
【问题讨论】:
标签: asp.net-web-api asp.net-core oauth-2.0 owin asp.net-core-2.0