Ejemplo n.º 1
0
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            var sqliteConnectionInitializer = new ApplicationDbInitializer(modelBuilder);//SqliteCreateDatabaseIfNotExists<ApplicationDbContext>(modelBuilder);

            Database.SetInitializer(sqliteConnectionInitializer);
            base.OnModelCreating(modelBuilder);
        }
Ejemplo n.º 2
0
        public static ApplicationDbInitializer Create(IdentityFactoryOptions <ApplicationDbInitializer> options, IOwinContext context)
        {
            if (_applicationDbInitializer != null)
            {
                return(_applicationDbInitializer);
            }

            lock (ThisLock)
            {
                if (_applicationDbInitializer != null)
                {
                    return(_applicationDbInitializer);
                }
                _applicationDbInitializer = new ApplicationDbInitializer(context);
            }
            return(_applicationDbInitializer);
        }