Latest release does not fix GetItemLinqQueryable issue [Still broken 3/2/23]
See original GitHub issueDescribe 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:
- Created 7 months ago
- Reactions:1
- Comments:18 (15 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I haven’t been able to get around to this yet. I’m hoping I will be able to tackle it in May
@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?