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)); }
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)); }
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)); }
public static TypedExpression KDPgJsonbAdd <T>(TypedExpression array, IEnumerable <object> jsonPath, T item) { var pgValue = PgTypesConverter.ConvertObjectToPgValue(item); return(KDPgJsonbAdd(array, jsonPath, TypedExpression.FromPgValue(pgValue))); }
public static TypedExpression ArrayRemoveItem <T>(TypedExpression array, T item) { var pgValue = PgTypesConverter.ConvertObjectToPgValue(item); return(ArrayRemoveItem(array, TypedExpression.FromPgValue(pgValue))); }
public static TypedExpression ContainsAny(TypedExpression left, IEnumerable array) => ContainsAny(left, TypedExpression.FromPgValue(PgTypesConverter.ConvertObjectToPgValue(array)));
public static TypedExpression FromValue(object value) { return(FromPgValue(PgTypesConverter.ConvertObjectToPgValue(value))); }