public void TestInit() { SessionsConfiguration configuration = SessionsConfigurationView.Instance.Configuration; Assert.IsNotNull(configuration); Assert.IsNotNull(configuration.Keys["SpringObjectFile"]); Assert.IsNotNull(configuration.Keys["IBatisMapping"]); }
/// <summary>构造函数</summary> public AccountCacheProvider() { this.configuration = SessionsConfigurationView.Instance.Configuration; this.ibatisMapping = this.configuration.Keys["IBatisMapping"].Value; this.storageSchemaId = this.configuration.Keys["StorageSchemaId"].Value; this.ibatisMappers = StorageContext.Instance.CreateSqlMappers(this.storageSchemaId, this.ibatisMapping); this.storageStrategy = StorageContext.Instance.StorageSchemaService[this.storageSchemaId].GetStrategyClass(); }
public void TestCreateMapper() { SessionsConfiguration configuration = SessionsConfigurationView.Instance.Configuration; ISqlMapper ibatisMapper = null; string ibatisMapping = configuration.Keys["IBatisMapping"].Value; ibatisMapper = ISqlMapHelper.CreateSqlMapper(ibatisMapping, true); Assert.IsNotNull(ibatisMapper); }
/// <summary>构造函数</summary> public AccountCacheService() { this.configuration = SessionsConfigurationView.Instance.Configuration; this.cacheStorage = new SyncDictionary <string, AccountCacheInfo>(); // 创建对象构建器(Spring.NET) string springObjectFile = this.configuration.Keys["SpringObjectFile"].Value; SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(SessionsConfiguration.ApplicationName, springObjectFile); this.provider = objectBuilder.GetObject <IAccountCacheProvider>(typeof(IAccountCacheProvider)); }