from ApplicationDbContext to IdentityServiceDbContext

Viewed 769

In ASP.NET Core 1.1 I used ApplicationDbContext for user identity context and for my models data, 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 asp.net core 2 preview.

But now we have IdentityServiceDbContext:

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

Question is: can I use IdentityServiceDbContext for my data or should I create sepatate dbcontext?

Looks like they moved IdentityServiceDbContext to identity service.

0 Answers
Related