Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderBy with RedisCollection<T> as IQueryable<T> using OData #516

Closed
mfaulcon opened this issue Feb 2, 2025 · 3 comments
Closed

OrderBy with RedisCollection<T> as IQueryable<T> using OData #516

mfaulcon opened this issue Feb 2, 2025 · 3 comments

Comments

@mfaulcon
Copy link

mfaulcon commented Feb 2, 2025

I see in the code that SearchExtensions.cs defines an OrderBy method on the IRedisCollection interface (among others):

public static IRedisCollection<T> OrderBy<T, TField>(this IRedisCollection<T> source, Expression<Func<T, TField>> expression)

However, I'm trying to use RedisOM with OData as an IQueryable data source, and OData is sending an OrderBy expression that ultimately is making it to the RedisQueryProvider.(Expression expression) method, which doesn't.
public TResult? Execute<TResult>(Expression expression)

Before I spend time trying to figure out how to make that work, is this a known problem with trying to use RedisOM with OData? Is there a workaround? If not, is this something that is going to be relatively easy to accomplish, or am I barking up the wrong tree?

@mfaulcon mfaulcon changed the title OrderBy with RedisCollection<T> as IQueryable<T> OrderBy with RedisCollection<T> as IQueryable<T> using OData Feb 2, 2025
@mfaulcon
Copy link
Author

mfaulcon commented Feb 2, 2025

Update:

I think this is less an OrderBy problem, and more an OData issue. Here's the expression it passed to RedisOM:

value(
  Redis.OM.Searching.RedisCollection`1[Graph.Caching.RedisOM.Users.CachedUser])
    .OrderBy(x => x.UserId)
    .Take(value(
      Microsoft.AspNetCore.OData.Query.Container.LinqParameterContainer+TypedLinqParameterContainer`1[System.Int32])
      .TypedProperty)

Not sure why its coming through this way...

@slorello89
Copy link
Member

@mfaulcon - can you provide me a minimal reproduction of the issue you are seeing?

@mfaulcon
Copy link
Author

mfaulcon commented Feb 7, 2025

Upon further investigation, this issue is overtaken by #518 - I did not trace the original issue down deeply enough; my apologies.

Closing...

@mfaulcon mfaulcon closed this as completed Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants