question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] Recommendations to replace IQueryable functionality?

See original GitHub issue

Query/Question I’m looking at upgrading from older versions of the SDK, but I see that this version doesn’t include IQueryable support. That’s fine for simple queries, but I have a number of places in my code where we have something to the effect of:

var query = CreateQuery<MyEntity>();
query = query.Where(e => e.PartitionKey == "whatever");

if (startDate.HasValue)
{
    query = query.Where(e => e.CreatedDate >= startDate.Value);
}

if (endDate.HasValue)
{
    query = query.Where(e => e.CreatedDate <= endDate.Value);
}

var result = await query.ExecuteSegmentedAsync();

If I understand the new library correctly, the only way I could replicate this kind of code is to build the OData strings myself. Is there a better way to handle this? Would you consider including some kind of query builder, even if it’s not based on IQueryable?

Environment:

  • Name and version of the Library package used: Azure.Data.Tables 12.2.0
  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): Azure Cloud Services, .NET Framework 4.7.2
  • IDE and version : Visual Studio

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
misholsoncommented, Sep 27, 2021

Thank you, this is exactly the info I needed!

0reactions
msftbot[bot]commented, Oct 4, 2021

Hi @misholson, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replace specific Objects in IQueryable query in .NET fails
Therefore, if you only replace some elements from query1 with elements from query2, then the result is of course also an IQueryable<TSource> ...
Read more >
8 Tips and Tricks for Writing the Best Queries in LINQ to ...
Pull only the needed columns; Use of IQueryable and Skip/Take; Use of left join and inner join at the right places; Use of...
Read more >
What to Return from Repositories: IQueryable, IEnumerable or ...
When it comes to implementing get methods in repositories which should return a collection of domain objects (GetUsers, GetProducts, ...
Read more >
Explain IEnumerable and IQueryable and how EF query works
Learn about how queries work behind the scene, and the difference between IEnumerable and IQueryable.
Read more >
IQueryable Interface (System.Linq)
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found