简体   繁体   中英

ASP.NET Core EF6 Identity

I am creating a new project in ASP.NET Core with EF6 as the ORM - Note note EF Core.

I am having issues trying to configure the Identity Store.

Here is what I have so far:

Startup.cs

 services.AddIdentity<ApplicationUser, IdentityRole>()
            .AddEntityFrameworkStores<ApplicationDbContext>()
            .AddDefaultTokenProviders();

This line is causing me the headache. AddEntityFrameworkStores is for EF Core and not the full version of EF 6.

How do I reference the underlying data store for EF6

Thanks

It seems like you have overridden the default data type of Id for ApplicationUser and IdentityRole.

Try AddEntityFrameworkStores<ApplicationDbContext, int>() , or the with type that you have overridden.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM