Beispiel #1
0
        /// <summary>
        ///     Creates a new instance of the <see cref="JoinExpressionBase" /> class.
        /// </summary>
        /// <param name="table"> A table source to join with. </param>
        protected JoinExpressionBase(TableExpressionBase table)
            : base(null)
        {
            Check.NotNull(table, nameof(table));

            Table = table;
        }
        /// <summary>
        ///     Creates a new instance of the <see cref="PredicateJoinExpressionBase" /> class.
        /// </summary>
        /// <param name="table"> A table source to join with. </param>
        /// <param name="joinPredicate"> A predicate to use for the join. </param>
        protected PredicateJoinExpressionBase(TableExpressionBase table, SqlExpression joinPredicate)
            : base(table)
        {
            Check.NotNull(joinPredicate, nameof(joinPredicate));

            JoinPredicate = joinPredicate;
        }
Beispiel #3
0
 internal ColumnExpression(ProjectionExpression subqueryProjection, TableExpressionBase table)
     : this(
         subqueryProjection.Alias, table,
         subqueryProjection.Type, subqueryProjection.Expression.TypeMapping,
         IsNullableProjection(subqueryProjection))
 {
 }
Beispiel #4
0
        /// <summary>
        ///     Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will
        ///     return this expression.
        /// </summary>
        /// <param name="table"> The <see cref="P:Table" /> property of the result. </param>
        /// <returns> This expression if no children changed, or an expression with the updated children. </returns>
        public virtual CrossApplyExpression Update(TableExpressionBase table)
        {
            Check.NotNull(table, nameof(table));

            return(table != Table
                ? new CrossApplyExpression(table)
                : this);
        }
        /// <summary>
        ///     Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will
        ///     return this expression.
        /// </summary>
        /// <param name="table"> The <see cref="P:Table" /> property of the result. </param>
        /// <returns> This expression if no children changed, or an expression with the updated children. </returns>
        public virtual OuterApplyExpression Update([NotNull] TableExpressionBase table)
        {
            Check.NotNull(table, nameof(table));

            return(table != Table
                ? new OuterApplyExpression(table)
                : this);
        }
Beispiel #6
0
        /// <summary>
        ///     Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will
        ///     return this expression.
        /// </summary>
        /// <param name="table"> The <see cref="P:Table" /> property of the result. </param>
        /// <param name="joinPredicate"> The <see cref="P:JoinPredicate" /> property of the result. </param>
        /// <returns> This expression if no children changed, or an expression with the updated children. </returns>
        public virtual InnerJoinExpression Update(TableExpressionBase table, SqlExpression joinPredicate)
        {
            Check.NotNull(table, nameof(table));
            Check.NotNull(joinPredicate, nameof(joinPredicate));

            return(table != Table || joinPredicate != JoinPredicate
                ? new InnerJoinExpression(table, joinPredicate)
                : this);
        }
Beispiel #7
0
 internal ColumnExpression(IProperty property, IColumnBase column, TableExpressionBase table, bool nullable)
     : this(
         column?.Name ?? property.GetColumnName(),
         table,
         property.ClrType,
         property.GetRelationalTypeMapping(),
         nullable || (column?.IsNullable ?? property.IsColumnNullable()))
 {
 }
 internal ColumnExpression(IProperty property, IColumnBase column, TableExpressionBase table, bool nullable)
     : this(
         column.Name,
         table,
         property.ClrType.UnwrapNullableType(),
         column.PropertyMappings.First(m => m.Property == property).TypeMapping,
         nullable || column.IsNullable)
 {
 }
Beispiel #9
0
 internal ColumnExpression(IProperty property, TableExpressionBase table, bool nullable)
     : this(
         property.GetTableColumnMappings().Cast <IColumnMappingBase>().Concat(property.GetViewColumnMappings())
         .FirstOrDefault()?.Column.Name   // TODO: this should take table into account
         ?? property.GetColumnName(),
         table,
         property.ClrType,
         property.GetRelationalTypeMapping(),
         nullable ||
         (property.GetTableColumnMappings().Cast <IColumnMappingBase>().Concat(property.GetViewColumnMappings())
          .FirstOrDefault()?.Column.IsNullable  // TODO: this should take table into account
          ?? property.IsColumnNullable()))
 {
 }
Beispiel #10
0
 /// <summary>
 ///     Creates a new instance of the <see cref="OuterApplyExpression" /> class.
 /// </summary>
 /// <param name="table"> A table source to OUTER APPLY with. </param>
 public OuterApplyExpression(TableExpressionBase table)
     : base(table)
 {
 }
 /// <summary>
 ///     Creates a new instance of the <see cref="OuterApplyExpression" /> class.
 /// </summary>
 /// <param name="table"> A table source to OUTER APPLY with. </param>
 public OuterApplyExpression([NotNull] TableExpressionBase table)
     : base(table)
 {
 }
 public virtual CrossJoinExpression Update(TableExpressionBase table)
 => table != Table
         ? new CrossJoinExpression(table)
         : this;
Beispiel #13
0
 /// <summary>
 ///     Creates a new instance of the <see cref="CrossApplyExpression" /> class.
 /// </summary>
 /// <param name="table"> A table source to CROSS APPLY with. </param>
 public CrossApplyExpression(TableExpressionBase table)
     : base(table)
 {
 }
 public virtual LeftJoinExpression Update(TableExpressionBase table, SqlExpression joinPredicate)
 => table != Table || joinPredicate != JoinPredicate
         ? new LeftJoinExpression(table, joinPredicate)
         : this;
Beispiel #15
0
 /// <summary>
 ///     Creates a new instance of the <see cref="InnerJoinExpression" /> class.
 /// </summary>
 /// <param name="table"> A table source to INNER JOIN with. </param>
 /// <param name="joinPredicate"> A predicate to use for the join. </param>
 public InnerJoinExpression(TableExpressionBase table, SqlExpression joinPredicate)
     : base(table, joinPredicate)
 {
 }
 public InnerJoinLateralExpression(TableExpressionBase table)
     : base(table)
 {
 }
 /// <summary>
 ///     Creates a new instance of the <see cref="JoinExpressionBase" /> class.
 /// </summary>
 /// <param name="table">A table source to join with.</param>
 protected JoinExpressionBase(TableExpressionBase table)
     : base(null)
 {
     Table = table;
 }
 public CrossJoinExpression(TableExpressionBase table)
     : base(table)
 {
 }
 public virtual InnerJoinLateralExpression Update(TableExpressionBase table)
 => table != Table
         ? new InnerJoinLateralExpression(table)
         : this;
Beispiel #20
0
 /// <summary>
 ///     Creates a new instance of the <see cref="CrossJoinExpression" /> class.
 /// </summary>
 /// <param name="table"> A table source to CROSS JOIN with. </param>
 public CrossJoinExpression([NotNull] TableExpressionBase table)
     : base(table)
 {
 }
Beispiel #21
0
 /// <summary>
 ///     Creates a new instance of the <see cref="InnerJoinExpression" /> class.
 /// </summary>
 /// <param name="table"> A table source to INNER JOIN with. </param>
 /// <param name="joinPredicate"> A predicate to use for the join. </param>
 public InnerJoinExpression([NotNull] TableExpressionBase table, [NotNull] SqlExpression joinPredicate)
     : base(table, joinPredicate)
 {
 }
 public LeftJoinLateralExpression(TableExpressionBase table)
     : base(table)
 {
 }
Beispiel #23
0
 public CrossApplyExpression([NotNull] TableExpressionBase table)
     : base(table)
 {
 }
Beispiel #24
0
 protected PredicateJoinExpressionBase(TableExpressionBase table, SqlExpression joinPredicate)
     : base(table)
 {
     JoinPredicate = joinPredicate;
 }
 public virtual OuterApplyExpression Update(TableExpressionBase table)
 => table != Table
         ? new OuterApplyExpression(table)
         : this;
 internal ColumnExpression(IProperty property, TableExpressionBase table, bool nullable)
     : this(property.GetColumnName(), table, property.ClrType, property.GetRelationalTypeMapping(),
            nullable || property.IsNullable || property.DeclaringEntityType.BaseType != null)
 {
 }