我正在使用 ASP.NET Core MVC
和 EntityFramework 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