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;
        }
Exemple #2
0
 protected SqlStatement(IStatementExecutor statementExecutor, IEntityMapper entityMapper)
 {
     this.StatementExecutor =
         statementExecutor ?? throw new ArgumentNullException(nameof(statementExecutor));
     this.EntityMapper = entityMapper ?? throw new ArgumentNullException(nameof(entityMapper));
     this.TableSchema  = CustomAttributeHandle.DbTableSchema <TEntity>();
     this.TableName    = CustomAttributeHandle.DbTableName <TEntity>();
 }
        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 AddTableSpecification <T>(JoinType joinType,
                                        string @alias      = null,
                                        string tableName   = null,
                                        string tableSchema = null)
 {
     this.ThrowIfTableAlreadyJoined <T>(@alias, tableName, tableSchema);
     this.Specification.Tables.Add(new SelectStatementTableSpecification
     {
         Alias      = alias,
         EntityType = typeof(T),
         JoinType   = joinType,
         TableName  = string.IsNullOrEmpty(tableName) ? CustomAttributeHandle.DbTableName <TEntity>() : tableName,
         Schema     = string.IsNullOrEmpty(tableSchema) ? CustomAttributeHandle.DbTableSchema <TEntity>() : tableSchema
     });
 }
Exemple #5
0
        protected override void AddTableSpecification <T>(
            JoinType joinType,
            string alias       = null,
            string tableName   = null,
            string tableSchema = null)
        {
            ThrowIfTableAlreadyJoined <T>(alias, tableName, tableSchema);
            var tables = Specification.Tables;
            var tableSpecification1 = new SelectStatementTableSpecification();

            tableSpecification1.Alias      = alias;
            tableSpecification1.EntityType = typeof(T);
            tableSpecification1.JoinType   = joinType;
            tableSpecification1.TableName  = string.IsNullOrEmpty(tableName) ? CustomAttributeHandle.DbTableName <T>() : tableName;
            tableSpecification1.Schema     = string.IsNullOrEmpty(tableSchema) ? CustomAttributeHandle.DbTableSchema <T>() : tableSchema;
            var tableSpecification2 = tableSpecification1;

            tables.Add(tableSpecification2);
        }