Open nongvantinh opened 1 week ago
What exactly do you mean? Can you pinpoint the relevant part of your example to show what you're trying to achieve? Is it the part where you create a query string to execute?
Sorry for the confusion. What I need is to work with dynamic properties for the Where
and OrderBy
clauses like this:
query = query.Where(string.Format("{0}.StartsWith(@0)", filterColumn), filterQuery);
query.OrderBy(string.Format("{0} {1}", sortColumn, sortOrder));
As I try to achieve this behavior, I see that I can only use strongly-typed methods for the Where
and OrderBy
clauses, like this:
gremlinQuerySource.V<Account>().Where(account => account.Email == email); // Same goes with all other properties in Account class
gremlinQuerySource.V<Account>().Order(orderBuilder => orderBuilder.By(account => account.FullName));
In my previous database, I used System.Linq.Dynamic
to interact with various properties in a class dynamically, depending on user input. For example, the Account table ("vertex") contains columns such as [id, email, phoneNumber, ...], allowing users to sort and filter based on one of these columns. However, as I am new to GremlinQ, I am unsure if it is possible to achieve similar behavior.
Would this work for you?
I'm moving from Entity Framework Core SQLServer to Cosmos DB for Gremlin. However, I am stuck in the querying process; there is not much information about its usage on the internet. So, I must ask my question here: Is it possible to use dynamic LINQ in Gremlinq, like in the code below?