Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public string GetKeyName()
 {
     return(_userCommandCreator.GetKeyName());
 }