Пример #1
0
        public static void AddAppTenants(HostDbContext context, Theme theme)
        {
            var appTenant = new AppTenant();

            appTenant.Name             = "Edux11BilgiKoleji";
            appTenant.Title            = "Bilgi Koleji Edux";
            appTenant.Hostname         = "localhost:60005";
            appTenant.Folder           = "bilgikoleji";
            appTenant.CreateDate       = DateTime.Now;
            appTenant.ThemeName        = "metronic";
            appTenant.Theme            = theme;
            appTenant.ConnectionString = $"Server=edux.bilgikoleji.com;Database={appTenant.Name};User Id=Edux;Password=Turkcoin34;MultipleActiveResultSets=true";
            context.AppTenants.Add(appTenant);
            context.SaveChanges();
        }
Пример #2
0
        public static void Initialize(this HostDbContext context)
        {
            // migration'ları veritabanına uygula
            context.Database.Migrate();

            // Look for any tenants record.
            if (context.AppTenants.Any())
            {
                return;   // DB has been seeded
            }
            // Perform seed operations
            var theme = AddTheme(context);

            AddAppTenants(context, theme);
        }
Пример #3
0
        public static Theme AddTheme(HostDbContext context)
        {
            var defaultTheme = new Theme();

            defaultTheme.Name            = "metronic";
            defaultTheme.Logo            = "/metronic/layouts/layout/img/logo.png";
            defaultTheme.ImageUrl        = "";
            defaultTheme.MetaDescription = "";
            defaultTheme.MetaTitle       = "";
            defaultTheme.MetaKeywords    = "";
            defaultTheme.CreateDate      = DateTime.Now;
            defaultTheme.UpdateDate      = DateTime.Now;
            defaultTheme.CreatedBy       = "UserName";
            defaultTheme.UpdatedBy       = "UserName";
            defaultTheme.CustomCSS       = "";
            context.Themes.Add(defaultTheme);
            context.SaveChanges();
            return(defaultTheme);
        }