public DbLogicModule(IHashCalculater hashCalc, bool hashFromValue, IUserCommandCreator <TCommand, TConnection, TKey, TValue, TReader> userCommandCreator, IMetaDataCommandCreator <TCommand, TReader> metaDataCommandCreator, DbImplModule <TCommand, TConnection, TReader> implModule) { Contract.Requires(hashCalc != null); Contract.Requires(userCommandCreator != null); Contract.Requires(implModule != null); Contract.Requires(metaDataCommandCreator != null); _hashCalculater = hashCalc; _userCommandCreator = userCommandCreator; _implModule = implModule; _hashFromValue = hashFromValue; _metaDataCommandCreator = metaDataCommandCreator; var idName = _userCommandCreator.GetKeyName(); _metaDataCommandCreator.SetKeyName(idName); var tableName = _userCommandCreator.GetTableNameList(); _metaDataCommandCreator.SetTableName(tableName); _tableName = tableName.Aggregate("", (current, result) => current + result + "_"); _tableName = _tableName.Remove(_tableName.Length - 1); }
public TestDbInMemory(string tableName, IHashCalculater hashCalculater) : base( hashCalculater, true, new TestUserCommandCreator(tableName), new TestMetaDataCommandCreator(), TestDbHelper.NewInstance ) { _impl = TestDbHelper.Instance; }
public static InnerData CreateEvent(IHashCalculater calc, int id) { string hash = calc.CalculateHashFromKey(id); var ev = new InnerData(new Transaction(hash, "") { OperationName = OperationName.Read }) { Data = calc.SerializeValue(CreateStoredData(id)) }; return(ev); }
public IStorageInner CreateApi(string tableName, bool hashFromValue, IHashCalculater hashCalculater) { if (_apis.ContainsKey(tableName)) { return(null); } var api = new ProxyInputModule( tableName, hashFromValue, _asyncProxyCache, hashCalculater, _distributor, this); _apis.Add(tableName, api); return(api); }
public ProxyInputModule(string tableName, bool hashFromValue, AsyncProxyCache asyncProxyCache, IHashCalculater hashCalculater, ProxyDistributorModule distributor, ProxyInputModuleCommon processTransaction) { Contract.Requires(distributor != null); Contract.Requires(hashCalculater != null); Contract.Requires(asyncProxyCache != null); Contract.Requires(processTransaction != null); _tableName = tableName; _distributor = distributor; _processTransaction = processTransaction; _hashFromValue = hashFromValue; _hashCalculater = hashCalculater; _asyncProxyCache = asyncProxyCache; }
public TestInMemoryDbFactory(string tableName, IHashCalculater hashCalculater) { _tableName = tableName; _hashCalculater = hashCalculater; }