Skip to content
This repository was archived by the owner on Aug 2, 2026. It is now read-only.
This repository was archived by the owner on Aug 2, 2026. It is now read-only.

ExecuteAsync FormattableString causing an unexpected answer #64

Description

@mordebip

Hello, i have been trying to make a generic get method for an easier generic implementation (with dynamic filters)

i am basically trying to build a query following this model

FormattableString limits = $"";
  if (pagingAndFilter.paging != null && pagingAndFilter.paging.numberOfElements != 0) 
    limits = $"limit {pagingAndFilter.paging.startPoint}, {pagingAndFilter.paging.numberOfElements}";

FormattableString filters = $"";
  if (pagingAndFilter.filters != null && pagingAndFilter.filters != "")
    filters = $"FILTER {pagingAndFilter.filters}";
    
FormattableString query = $" FOR c IN {collectionName} {filters} {limits} RETURN c";

For the situation where i will send the following arguments

{
  "paging": {
    "startPoint": 0,
    "numberOfElements": 10
  },
  "filters": "c.name == 'filteringName'"
}

The fiilters aren't being applied even if the value of query is "FOR c IN Product filter c.name == 'filteringName' limit 0, 10 RETURN c" which is a correctly formatted query

I was also thinking about sending the Filtering and Limit part as a static string, but it raised a lot of other issues, having a method to execute AQL from a simple and plain string could solve a lot of issues and offer a last ressort alternative

Edit : When trying to flatten the Filter part (@p2) with Invariant i get the following error

AQL: syntax error, unexpected bind parameter near '@P2 limit @P3, @P4 RETURN c' at position 1:14 (while parsing)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions