nkovacic / AzureSearchToolkit

AzureSearchToolkit is a lightweight set of tools for Azure Search to quickly build search functionalities for .NET Standard web apps.
Apache License 2.0
8 stars 4 forks source link

Property Casing API Error #9

Open chrisjainsley opened 2 months ago

chrisjainsley commented 2 months ago

The line fieldNames.Add(m.Member.Name.ToLowerInvariant()); in MemberProjectionExpressionVisitor.cs seems to convert all property names to lowercase, regardless of whether they are pascal or camel case. It's unclear if the Azure Search API previously permitted varying cases, but it appears to be causing issues now.

A quick solution was to eliminate the ToLowerInvariant() method, but a more robust approach might be to check for the JsonProperty attribute and use it as the default setting. Do you have any thoughts on this? Happy to create a PR with a solution.

"Invalid expression: Could not find a property named 'id' on type 'search.document'.\r\nParameter name: $select"

nkovacic commented 2 months ago

This package is not actively maintained anymore, so PRs are welcome 🙏.