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 useASP.NET Core MVC using zzzz-8 zzzz (not EF Core, since Oracle does not currently support EF7 for Oracle)

AddEntityFrameworkStores is not an option for me since ApplicationDbContext must beMicrosoft.EntityFrameworkCore.DbContext

In Identity, I don't have to use EntityFramework; is there any method I could utilise Oracle and Asp.NET Core Identity?

public void ConfigureServices(IServiceCollection services)
        {    

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

        }

Error CS0311: You cannot use the generic type or method "IdentityEntityFrameworkBuilderExtensions.AddEntityFrameworkStores(IdentityBuilder)" with the type "x.Models.ApplicationDbContext" as a type argument "TContext." From "x.Models.ApplicationDbContext" to "Microsoft.EntityFrameworkCore.DbContext," there is no implicit reference conversion. 4.5.2 of the MPWebApplicationCore.NET Framework

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

Popular Answer

I discovered an ASP.NET Core Identity example that does not need Entity Framework.

for asp.net core, change dependency sources toMicrosoft.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