/// <summary> /// Constructs a <see cref="PostgresAllExpression"/>. /// </summary> /// <param name="operatorType">The operator symbol to the array expression.</param> /// <param name="item">The value to find.</param> /// <param name="array">The array to search.</param> /// <param name="typeMapping">The type mapping for the expression.</param> public PostgresAllExpression( SqlExpression item, SqlExpression array, PostgresAllOperatorType operatorType, RelationalTypeMapping?typeMapping) : base(typeof(bool), typeMapping) { if (!(array.Type.IsArrayOrGenericList() || array is SqlConstantExpression { Value : null }))
/// <summary> /// Constructs a <see cref="PostgresAllExpression"/>. /// </summary> /// <param name="operatorType">The operator symbol to the array expression.</param> /// <param name="item">The value to find.</param> /// <param name="array">The array to search.</param> /// <param name="typeMapping">The type mapping for the expression.</param> public PostgresAllExpression( [NotNull] SqlExpression item, [NotNull] SqlExpression array, PostgresAllOperatorType operatorType, [CanBeNull] RelationalTypeMapping typeMapping) : base(typeof(bool), typeMapping) { if (!array.Type.IsArrayOrGenericList()) { throw new ArgumentException("Array expression must be of type array or List<>", nameof(array)); } Item = item; Array = array; OperatorType = operatorType; }
public virtual PostgresAllExpression All( [NotNull] SqlExpression item, [NotNull] SqlExpression array, PostgresAllOperatorType operatorType) => (PostgresAllExpression)ApplyDefaultTypeMapping(new PostgresAllExpression(item, array, operatorType, null));