Exemplo n.º 1
0
        public void Create()
        {
            new DefaultEditionCreator(_context).Create();
            new DefaultLanguagesCreator(_context).Create();
            //new HostRoleAndUserCreator(_context).Create();
            //new DefaultSettingsCreator(_context).Create();

            _context.SaveChanges();
        }
Exemplo n.º 2
0
        private void AddLanguageIfNotExists(ApplicationLanguage language)
        {
            //if (_context.Languages.IgnoreQueryFilters().Any(l => l.TenantId == language.TenantId && l.Name == language.Name))
            //{
            //    return;
            //}

            //_context.Languages.Add(language);
            _context.SaveChanges();
        }
Exemplo n.º 3
0
        private void CreateFeatureIfNotExists(int editionId, string featureName, bool isEnabled)
        {
            //if (_context.EditionFeatureSettings.IgnoreQueryFilters().Any(ef => ef.EditionId == editionId && ef.Name == featureName))
            //{
            //    return;
            //}

            //_context.EditionFeatureSettings.Add(new EditionFeatureSetting
            //{
            //    Name = featureName,
            //    Value = isEnabled.ToString(),
            //    EditionId = editionId
            //});
            _context.SaveChanges();
        }
Exemplo n.º 4
0
        private void CreateDefaultTenant()
        {
            //// Default tenant

            //var defaultTenant = _context.Tenants.IgnoreQueryFilters().FirstOrDefault(t => t.TenancyName == AbpTenantBase.DefaultTenantName);
            //if (defaultTenant == null)
            //{
            //    defaultTenant = new Tenant(AbpTenantBase.DefaultTenantName, AbpTenantBase.DefaultTenantName);

            //    var defaultEdition = _context.Editions.IgnoreQueryFilters().FirstOrDefault(e => e.Name == EditionManager.DefaultEditionName);
            //    if (defaultEdition != null)
            //    {
            //        defaultTenant.EditionId = defaultEdition.Id;
            //    }

            //    _context.Tenants.Add(defaultTenant);
            _context.SaveChanges();
            //}
        }