Esempio n. 1
0
        public async Task StartAsync(CancellationToken cancellationToken = default)
        {
            using (var scope = _serviceProvider.CreateScope())
            {
                IDataSeedContributor dataSeedContributor = scope.ServiceProvider.GetRequiredService <IDataSeedContributor>();

                await dataSeedContributor.SeedAsync();
            }
        }
Esempio n. 2
0
        public async Task StartAsync(CancellationToken cancellationToken = default)
        {
            try
            {
                using var scope = _serviceProvider.CreateScope();
                IDataSeedContributor dataSeedContributor = scope.ServiceProvider.GetRequiredService <IDataSeedContributor>();
                await dataSeedContributor.SeedPermissionAsync();

                await dataSeedContributor.InitAdminPermission();
            }
            catch (Exception ex)
            {
                _logger.LogError("初始化数据失败!!!", ex);
            };
        }
Esempio n. 3
0
        public async Task StartAsync(CancellationToken cancellationToken = default)
        {
            try
            {
                using var scope = _serviceProvider.CreateScope();
                IDataSeedContributor dataSeedContributor = scope.ServiceProvider.GetRequiredService <IDataSeedContributor>();

                var permissions = ReflexHelper.GetAssemblyLinCmsAttributes();
                await dataSeedContributor.SeedPermissionAsync(permissions);

                await dataSeedContributor.InitAdminPermission();
            }
            catch (Exception ex)
            {
                _logger.LogError($"初始化数据失败!!!{ex.Message}{ex.StackTrace}{ex.InnerException}");
            };
        }