예제 #1
0
    public static WhereBuilder<TModel> Eq<T>(Expression<Func<TModel, T>> field, T value)
    {
      var column = NodeVisitor.EvaluateExpressionToColumn(field.Body);
      var pgValue = PgTypesConverter.ConvertObjectToPgValue(value);

      var right = TypedExpression.FromPgValue(pgValue);

      return new WhereBuilder<TModel>(ExpressionBuilders.Eq(column.TypedExpression, right));
    }
예제 #2
0
        public static TypedExpression In(TypedExpression left, IEnumerable array)
        {
            RawQuery rq = new RawQuery();

            rq.AppendSurround(left.RawQuery)
            .Append(" = ANY(")
            .Append(PgTypesConverter.ConvertObjectToPgValue(array))
            .Append(")");

            return(new TypedExpression(rq, KDPgValueTypeInstances.Boolean));
        }
예제 #3
0
        public static TypedExpression KDPgJsonbRemoveByValue <T>(TypedExpression array, IEnumerable <object> jsonPath, T item, bool firstOnly)
        {
            var pgValue = PgTypesConverter.ConvertObjectToPgValue(item);

            return(KDPgJsonbRemoveByValue(array, jsonPath, TypedExpression.FromPgValue(pgValue), firstOnly));
        }
예제 #4
0
        public static TypedExpression KDPgJsonbAdd <T>(TypedExpression array, IEnumerable <object> jsonPath, T item)
        {
            var pgValue = PgTypesConverter.ConvertObjectToPgValue(item);

            return(KDPgJsonbAdd(array, jsonPath, TypedExpression.FromPgValue(pgValue)));
        }
예제 #5
0
        public static TypedExpression ArrayRemoveItem <T>(TypedExpression array, T item)
        {
            var pgValue = PgTypesConverter.ConvertObjectToPgValue(item);

            return(ArrayRemoveItem(array, TypedExpression.FromPgValue(pgValue)));
        }
예제 #6
0
 public static TypedExpression ContainsAny(TypedExpression left, IEnumerable array)
 => ContainsAny(left, TypedExpression.FromPgValue(PgTypesConverter.ConvertObjectToPgValue(array)));
예제 #7
0
 public static TypedExpression FromValue(object value)
 {
     return(FromPgValue(PgTypesConverter.ConvertObjectToPgValue(value)));
 }