Ejemplo n.º 1
0
 protected abstract TCommand CreateCommand(ICommandExecutor commandExecutor,
                                           IEntityMapper entityMapper,
                                           IWritablePropertyMatcher writablePropertyMatcher,
                                           ISelectClauseBuilder selectClauseBuilder,
                                           IFromClauseBuilder fromClauseBuilder,
                                           IWhereClauseBuilder whereClauseBuilder,
                                           string connectionString);
Ejemplo n.º 2
0
 protected abstract TStatement CreateStatement(IStatementExecutor statementExecutor,
                                               IEntityMapper entityMapper,
                                               IWritablePropertyMatcher writablePropertyMatcher,
                                               ISelectClauseBuilder selectClauseBuilder,
                                               IFromClauseBuilder fromClauseBuilder,
                                               IWhereClauseBuilder whereClauseBuilder,
                                               ISqlConnectionProvider connectionProvider);
Ejemplo n.º 3
0
 public InsertCommand(ICommandExecutor commandExecutor,
                      IEntityMapper entityMapper,
                      IWritablePropertyMatcher writablePropertyMatcher)
     : base(commandExecutor, entityMapper)
 {
     this.writablePropertyMatcher = writablePropertyMatcher;
 }
Ejemplo n.º 4
0
 public InsertStatement(IStatementExecutor statementExecutor,
                        IEntityMapper entityMapper,
                        IWritablePropertyMatcher writablePropertyMatcher)
     : base(statementExecutor, entityMapper)
 {
     this.writablePropertyMatcher = writablePropertyMatcher;
 }
Ejemplo n.º 5
0
        protected SqlStatement(IStatementExecutor statementExecutor, IEntityMapper entityMapper, IWritablePropertyMatcher writablePropertyMatcher)
        {
            IStatementExecutor statementExecutor1 = statementExecutor;

            if (statementExecutor1 == null)
            {
                throw new ArgumentNullException(nameof(statementExecutor));
            }
            StatementExecutor = statementExecutor1;
            IEntityMapper entityMapper1 = entityMapper;

            if (entityMapper1 == null)
            {
                throw new ArgumentNullException(nameof(entityMapper));
            }
            EntityMapper = entityMapper1;
            TableSchema  = CustomAttributeHandle.DbTableSchema <TEntity>();
            TableName    = CustomAttributeHandle.DbTableName <TEntity>();
            IWritablePropertyMatcher writablePropertyMatcher1 = writablePropertyMatcher;

            if (writablePropertyMatcher1 == null)
            {
                throw new ArgumentNullException(nameof(writablePropertyMatcher));
            }
            WritablePropertyMatcher = writablePropertyMatcher1;
        }
Ejemplo n.º 6
0
 public CommandFactory(ICommandExecutor commandExecutor,
                       IEntityMapper entityMapper,
                       IWritablePropertyMatcher writablePropertyMatcher)
 {
     this.commandExecutor         = commandExecutor;
     this.entityMapper            = entityMapper;
     this.writablePropertyMatcher = writablePropertyMatcher;
 }
Ejemplo n.º 7
0
 public SelectStatement(
     IStatementExecutor statementExecutor,
     IEntityMapper entityMapper,
     IWritablePropertyMatcher writablePropertyMatcher)
     : base(statementExecutor, entityMapper, writablePropertyMatcher)
 {
     InitialiseConfig();
 }
 protected SelectStatementBase(
     IStatementExecutor statementExecutor,
     IEntityMapper entityMapper,
     IWritablePropertyMatcher writablePropertyMatcher)
     : base(statementExecutor, entityMapper, writablePropertyMatcher)
 {
     //  InitialiseConfig();
 }
Ejemplo n.º 9
0
 public DeleteStatement(
     IStatementExecutor statementExecutor,
     IEntityMapper entityMapper,
     IWhereClauseBuilder whereClauseBuilder,
     IWritablePropertyMatcher writablePropertyMatcher)
     : base(statementExecutor, entityMapper, whereClauseBuilder, writablePropertyMatcher)
 {
 }
Ejemplo n.º 10
0
 public UpdateCommand(ICommandExecutor commandExecutor,
                      IEntityMapper entityMapper,
                      IWritablePropertyMatcher writablePropertyMatcher,
                      IWhereClauseBuilder whereClauseBuilder)
     : base(commandExecutor, entityMapper)
 {
     this.writablePropertyMatcher = writablePropertyMatcher;
     this.whereClauseBuilder      = whereClauseBuilder;
 }
Ejemplo n.º 11
0
 public UpdateStatement(IStatementExecutor statementExecutor,
                        IEntityMapper entityMapper,
                        IWritablePropertyMatcher writablePropertyMatcher,
                        IWhereClauseBuilder whereClauseBuilder)
     : base(statementExecutor, entityMapper)
 {
     this.writablePropertyMatcher = writablePropertyMatcher;
     this.whereClauseBuilder      = whereClauseBuilder;
 }
Ejemplo n.º 12
0
 public StatementFactoryProvider(IEntityMapper entityMapper,
                                 IWritablePropertyMatcher writablePropertyMatcher,
                                 IConnectionProvider connectionProvider,
                                 ISqlLogger sqlLogger)
 {
     this.entityMapper            = entityMapper;
     this.writablePropertyMatcher = writablePropertyMatcher;
     this.connectionProvider      = connectionProvider;
     this.sqlLogger = sqlLogger;
 }
Ejemplo n.º 13
0
 public MsSqlStatementFactoryProvider(
     IEntityMapper entityMapper,
     IWritablePropertyMatcher writablePropertyMatcher,
     IMsSqlConnectionProvider connectionProvider,
     IStatementExecutor statementExecutor,
     ISqlLogger sqlLogger)
 {
     this.entityMapper            = entityMapper;
     this.writablePropertyMatcher = writablePropertyMatcher;
     this.connectionProvider      = connectionProvider;
     this.sqlLogger         = sqlLogger;
     this.statementExecutor = statementExecutor;
 }
Ejemplo n.º 14
0
        protected override DeleteCommand <TestEntity> CreateCommand(ICommandExecutor commandExecutor,
                                                                    IEntityMapper entityMapper,
                                                                    IWritablePropertyMatcher writablePropertyMatcher,
                                                                    ISelectClauseBuilder selectClauseBuilder,
                                                                    IFromClauseBuilder fromClauseBuilder,
                                                                    IWhereClauseBuilder whereClauseBuilder,
                                                                    string connectionString)
        {
            var command = new DeleteCommand <TestEntity>(commandExecutor, entityMapper, whereClauseBuilder);

            command.UseConnectionString(connectionString);
            return(command);
        }
Ejemplo n.º 15
0
 public StatementFactory(
     ISqlLogger sqlLogger,
     IConnectionProvider connectionProvider,
     IEntityMapper entityMapper,
     IStatementExecutor statementExecutor,
     IWritablePropertyMatcher writablePropertyMatcher)
 {
     this.sqlLogger               = sqlLogger;
     GetConnectionProvider        = connectionProvider;
     this.entityMapper            = entityMapper;
     this.writablePropertyMatcher = writablePropertyMatcher;
     StatementExecutor            = statementExecutor;
 }
Ejemplo n.º 16
0
        protected override SelectStatement <TestEntity> CreateStatement(IStatementExecutor statementExecutor,
                                                                        IEntityMapper entityMapper,
                                                                        IWritablePropertyMatcher writablePropertyMatcher,
                                                                        ISelectClauseBuilder selectClauseBuilder,
                                                                        IFromClauseBuilder fromClauseBuilder,
                                                                        IWhereClauseBuilder whereClauseBuilder,
                                                                        ISqlConnectionProvider connectionProvider)
        {
            var statement = new SelectStatement <TestEntity>(statementExecutor, entityMapper);

            statement.UseConnectionProvider(connectionProvider);
            return(statement);
        }
Ejemplo n.º 17
0
        protected SqlStatement(IStatementExecutor statementExecutor, IEntityMapper entityMapper,
                               IWritablePropertyMatcher writablePropertyMatcher)
        {
            ;
            StatementExecutor = statementExecutor ?? throw new ArgumentNullException(nameof(statementExecutor));
            var entityMapper1 = entityMapper;

            EntityMapper = entityMapper1 ?? throw new ArgumentNullException(nameof(entityMapper));
            TableSchema  = CustomAttributeHandle.DbTableSchema <TEntity>();
            TableName    = CustomAttributeHandle.DbTableName <TEntity>();
            var writablePropertyMatcher1 = writablePropertyMatcher;

            WritablePropertyMatcher = writablePropertyMatcher1 ?? throw new ArgumentNullException(nameof(writablePropertyMatcher));
        }
 private void AssumeWritablePropertyMatcherIsInitialised()
 {
     this.writablePropertyMatcher = Substitute.For <IWritablePropertyMatcher>();
 }