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(); }
public void Init() { #if NETCOREAPP3_1_OR_GREATER //初始化配置文件 Assembly entryAssembly = Assembly.GetExecutingAssembly(); Configuration configuration = ConfigurationExtension.GetConfigurationFromAssembly(entryAssembly); RedisSection.Initialize(configuration); #endif }
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); }