Exemplo n.º 1
0
        public static void InitializeIdentityStorages(IServiceProvider serviceProvider, ApplicationDbContextSettings settings, List <ClientConfiguration> clientConfigurations)
        {
            serviceProvider
            .MigrateDbContext <PersistedGrantDbContext>((_, __) => { })
            .MigrateDbContext <ApplicationDbContext>((context, services) =>
            {
                var env    = services.GetService <IHostingEnvironment>();
                var logger = services.GetService <ILogger <ApplicationDbContextSeed> >();

                new ApplicationDbContextSeed()
                .SeedAsync(context, env, logger, settings)
                .Wait();
            })
            .MigrateDbContext <ConfigurationDbContext>((context, services) =>
            {
                new ConfigurationDbContextSeed(clientConfigurations)
                .SeedAsync(context)
                .Wait();
            });
        }
Exemplo n.º 2
0
        //private readonly IPasswordHasher<ApplicationUser> _passwordHasher = new PasswordHasher<ApplicationUser>();

        public Task SeedAsync(ApplicationDbContext context, IHostingEnvironment env,
                              ILogger <ApplicationDbContextSeed> logger, ApplicationDbContextSettings settings)
        {
            return(Task.CompletedTask);
        }