Пример #1
0
        public void Init()
        {
            //初始化配置文件
            Assembly      entryAssembly = Assembly.GetExecutingAssembly();
            Configuration configuration = ConfigurationExtension.GetConfigurationFromAssembly(entryAssembly);

            FrameworkSection.Initialize(configuration);
            DependencyInjectionSection.Initialize(configuration);
            RedisSection.Initialize(configuration);

            if (!ResolveMediator.ContainerBuilt)
            {
                IServiceCollection builder = ResolveMediator.GetServiceCollection();
                builder.RegisterConfigs();

                ResolveMediator.Build();
            }

            DbSession dbSession = new DbSession();

            dbSession.Database.EnsureCreated();

            this._unitOfWork = ResolveMediator.Resolve <IUnitOfWorkStub>();

            GlobalSetting.InitCurrentSessionId();
        }
Пример #2
0
        public void Init()
        {
#if NETCOREAPP3_1_OR_GREATER
            //初始化配置文件
            Assembly      entryAssembly = Assembly.GetExecutingAssembly();
            Configuration configuration = ConfigurationExtension.GetConfigurationFromAssembly(entryAssembly);
            RedisSection.Initialize(configuration);
#endif
        }
Пример #3
0
        public void Init()
        {
#if NETCOREAPP3_1_OR_GREATER
            //初始化配置文件
            Assembly      entryAssembly = Assembly.GetExecutingAssembly();
            Configuration configuration = ConfigurationExtension.GetConfigurationFromAssembly(entryAssembly);
            RedisSection.Initialize(configuration);
#endif

            IDatabase database = RedisManager.Instance.GetDatabase();
            database.StringSet(ReadKey, ReadValue);
        }