ASP.NET Core MVC with Identity 2 & EntityFramework 6(Oracle)

asp.net-core-mvc asp.net-identity-2 c# entity-framework-6 oracle

Question

I am using ASP.NET Core MVC with EntityFramework 6(not EF Core, because oracle not provide EF7 for Oracle support yet)

i am unable to use AddEntityFrameworkStores since ApplicationDbContext required to be Microsoft.EntityFrameworkCore.DbContext

I dont have to use EntityFramework In Identity, Is it other way i use 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

        }

Error CS0311 The type 'x.Models.ApplicationDbContext' cannot be used as type parameter 'TContext' in the generic type or method 'IdentityEntityFrameworkBuilderExtensions.AddEntityFrameworkStores(IdentityBuilder)'. There is no implicit reference conversion from 'x.Models.ApplicationDbContext' to 'Microsoft.EntityFrameworkCore.DbContext'. MPWebApplicationCore..NET Framework 4.5.2

1
3
8/17/2016 2:50:19 AM

Popular Answer

i Found an example for ASP.NET Core Identity without Entity Framework

for asp.net core change dependencies from Microsoft.AspNet to Microsoft.AspNetCore change Microsoft.AspNet.Identity to Microsoft.AspNetCore.Identity

https://github.com/MatthewKing/IdentityWithoutEF/tree/58631cda6e1a719ea513e49ba65c152d8cf78ec1

0
8/18/2016 6:37:04 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow