ASP.NET Core MVC使用Identity 2和EntityFramework 6(Oracle)

3

我正在使用 ASP.NET Core MVCEntityFramework 6(不是EF Core,因为Oracle尚未提供支持Oracle的EF7)

由于ApplicationDbContext需要Microsoft.EntityFrameworkCore.DbContext,所以我无法使用AddEntityFrameworkStores。

我不必在Identity中使用EntityFramework,是否有其他方法可以使用Asp.NET Core Identity with Oracle

public void ConfigureServices(IServiceCollection services)
        {    

var a=services.AddIdentity<ApplicationUser, Microsoft.AspNet.Identity.CoreCompat.IdentityRole>();
            a.AddEntityFrameworkStores<ApplicationDbContext>().AddDefaultTokenProviders();//Error Compile

        }

错误 CS0311 类型'x.Models.ApplicationDbContext'不能用作泛型类型或方法'IdentityEntityFrameworkBuilderExtensions.AddEntityFrameworkStores(IdentityBuilder)'中的类型参数'TContext'。'x.Models.ApplicationDbContext'到'Microsoft.EntityFrameworkCore.DbContext'之间没有隐式引用转换。MPWebApplicationCore..NET Framework 4.5.2

1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接