Ejemplo n.º 1
0
 public IDatabaseManager(ILogger iLogger, IConnectionManager iConnectionManager,
                         IDatabaseExecutor iDatabaseExecutor, IParamaterExtractor iParameterExtractor)
 {
     this.iLogger             = iLogger;
     this.iconnectionManager  = iConnectionManager;
     this.iDatabaseExecutor   = iDatabaseExecutor;
     this.iParameterExtractor = iParameterExtractor;
 }
        private DbParameter CreateIntParameter(string name, int value)
        {
            IDatabaseExecutor db = this.databaseExecutor();

            return(db.CreateParameter(
                       name: name,
                       type: DbType.Int32,
                       direction: ParameterDirection.Input,
                       value: value));
        }
 /// <summary>Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the <see cref="T:TinyMCE.Business.ConvertBlocks.ConvertBlockTypeDB" /> class.
 /// </summary>
 /// <exclude />
 public ConvertBlockTypeDb(
     IDatabaseExecutor databaseHandler,
     IContentRepository contentRepository,
     ILanguageBranchRepository languageBranchRepository,
     IPropertyDefinitionRepository propertyDefinitionRepository)
     : base(databaseHandler)
 {
     _contentRepository            = contentRepository;
     _languageBranchRepository     = languageBranchRepository;
     _propertyDefinitionRepository = propertyDefinitionRepository;
 }
        private DbCommand CreateCommand(string sqlCommand, params DbParameter[] parameters)
        {
            IDatabaseExecutor db = this.databaseExecutor();

            DbCommand command = db.CreateCommand();

            foreach (DbParameter parameter in parameters)
            {
                command.Parameters.Add(value: parameter);
            }

            command.CommandText = sqlCommand;
            command.CommandType = CommandType.Text;
            return(command);
        }
        private DataTable ExecuteDataTableQuery(DbCommand command)
        {
            IDatabaseExecutor db = this.databaseExecutor();

            DbDataAdapter adapter = db.DbFactory.CreateDataAdapter();

            if (adapter == null)
            {
                throw new Exception("[Prediction Engine] Unable to create DbDataAdapter");
            }

            adapter.SelectCommand = command;
            DataSet ds = new DataSet();

            adapter.Fill(dataSet: ds);
            return(ds.Tables[0]);
        }
        private IEnumerable <ProductCoPurchasePrediction> ExecuteQuery(Func <DbCommand> createCommand)
        {
            IDatabaseExecutor db = this.databaseExecutor();

            return(db.Execute(
                       () =>
            {
                try
                {
                    return this.ExecuteEnumerableQuery(createCommand());
                }
                catch (Exception ex)
                {
                    Logger.Error("[Prediction Engine] An error occurred while retrieving predictions.", exception: ex);
                    throw;
                }
            }));
        }
        private void ExecuteNonQuery(Func <DbCommand> createCommand, string errorMessage)
        {
            IDatabaseExecutor db = this.databaseExecutor();

            db.Execute(
                () =>
            {
                try
                {
                    createCommand().ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    Logger.Error(message: errorMessage, exception: ex);
                    throw;
                }
            });
        }
Ejemplo n.º 8
0
 public DataAccessBaseEx(IDatabaseExecutor handler)
     : base(handler)
 {
     Executor = handler;
 }
Ejemplo n.º 9
0
 public SqlRedirectRepository(IDatabaseExecutor executor)
 {
     _executor = executor ?? throw new ArgumentNullException(nameof(executor));
 }
Ejemplo n.º 10
0
 public RecipientData(IDatabaseExecutor databaseHandler)
     : base(databaseHandler)
 {
     this.Executor = databaseHandler;
 }
Ejemplo n.º 11
0
 public DatabaseManager(ILogger iLogger, IConnectionManager iconnectionManager,
                        IDatabaseExecutor iDatabaseExecutor, IParamaterExtractor iParameterExtractor)
     : base(iLogger, iconnectionManager, iDatabaseExecutor, iParameterExtractor)
 {
 }
Ejemplo n.º 12
0
 public WorkItemData(IDatabaseExecutor databaseHandler)
     : base(databaseHandler)
 {
     this.Executor = databaseHandler;
 }
 public DatabaseLockedSynchronizationContext(IDatabaseExecutor executor)
 {
     this.executor = executor;
 }
Ejemplo n.º 14
0
 public JobData(IDatabaseExecutor databaseHandler)
     : base(databaseHandler)
 {
     this.Executor = databaseHandler;
 }