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.

Latest release does not fix GetItemLinqQueryable issue [Still broken 3/2/23]

See original GitHub issue

Describe the bug

#3406 does not completely address #3207, with respect to enum handling in LINQ queries; it will still use the enum’s integer value, discarding the serializer preference set on the Cosmos context;

i.e.

enum MyEnum
{
  ValueA = 0
}

When querying

query.Where(c => c.Item == MyEnum.ValueA)

will translate to

WHERE root["Item"] = 0
-- Should be WHERE root["Item"] == "ValueA", if JsonStringEnumConverter is configured on JSON Serializer settings

Issue Analytics

  • State:open
  • Created 7 months ago
  • Reactions:1
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
leminh98commented, Apr 25, 2023

I haven’t been able to get around to this yet. I’m hoping I will be able to tackle it in May

2reactions
jackbondcommented, Feb 12, 2023

@onionhammer Are you using System.Text.Json in your custom serializer? If so, I’d try decorating the property with

[System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))]

(full namespaces included for clarity)

What’s literally bonkers about this is, we’re using the custom serializer 100% as intended, and it’s FUNDAMENTALLY BROKEN. And it has been FUNDAMENTALLY BROKEN for numerous releases. Do the people coding this not realize how their code is intended to be used? Both inexplicable and unforgiveable. Where’s the testing? Where are the unit tests? Where’s QA? Where’s the PM? Where’s the accountability?

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetItemLinqQueryable doesn't return any items
I believe your issue has to do with how the linq query in serialized. By default GetItemLinqQueryable doesn't use camel case.
Read more >
Container.GetItemLinqQueryable<T> Method
This method creates a LINQ query for items under a container in an Azure Cosmos DB service. IQueryable extension method ToFeedIterator() should be...
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