Hi everyone,
I am new to asp.net core and i started working on asp.net from version 5.0 core. I have switched to asp.net from laravel php framework. This was my brief introduction. I have been working on asp.net and using database first approach i built dbcontext and implemented my whole system in asp.net but in start i wanted to use identity scaffolding and use all commands that added a new identitydbcontext. So i have now two dbcontext one is asp.net core default with only identity and other is my database from db first approach.
I have implemented the default identity system by using
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = false)
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>();
But after this i wanted to authenticate users against a custom model tblemployee with fields i.e phone and scale. But when i try to add this by using a method that I found here Asp.net core 2.0 multiple identity .
My code to do that is
services.AddIdentityCore<TblEmployee>().AddEntityFrameworkStores<DbBzuCCContext>().AddDefaultTokenProviders();
But the code is not working it says that extend from IdentityUser but i can't use identityuser fields in my model. I just want to use my 2 fields to work as additional identity provider. Is there any way in middle ware to change default route for different identity and all my previous controllers to be used from default identity but new one with other identity.
Any help will be highly appreciated.
Regards,