예제 #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);
        }