From ApplicationDbContext to IdentityServiceDbContext

In ASP.NET Core 1.1, I used ApplicationDbContext for the context of user authentication and for the data of my models, following this .

public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
        }            
    }

and in Startup -> Configuration:

services.AddDbContext<ApplicationDbContext>(options =>
                options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

Now I'm trying to preview asp.net core 2 .

But now we have IdentityServiceDbContext:

public class IdentityServiceDbContext : IdentityServiceDbContext<ApplicationUser, IdentityServiceApplication>
    {
        public IdentityServiceDbContext(DbContextOptions<IdentityServiceDbContext> options)
            : base(options)
        {
        }            
    }

Question: can I use IdentityServiceDbContext for my data or do I need to create a sepatate dbcontext?

It looks like they have migrated IdentityServiceDbContext to the identity service.

+4
source share

Source: https://habr.com/ru/post/1677375/


All Articles