-
Notifications
You must be signed in to change notification settings - Fork 494
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
Add support for property overrides #4584
Comments
Can you share which SDK version you are using? |
Seems related to #4138 ? |
I just updated my original ticket description with more details |
Tried with 3.37.1 and 3.41.0 and the behaviour is the same |
If I'm not mistaken this is about enabling |
@PanosKousidis To enable |
Thanks @Maya-Painter , but the issue is still there. I've drilled down and I think the behaviour I see is not Cosmos SDK-related There is a lambda expression passed in azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs Lines 1515 to 1521 in 6e1d40d
And even though the expression itself references the ChildClass, the member referenced in "Left" is the Name property of the ParentClass instead of the ChildClass. See screenshot below It is not using the declared property of the ChildClass as seen in the Expression property You can probably close this ticket if you also think that there is nothing that can be done on the Cosmos SDK side to alleviate this |
I have the following case:
I have a couple of classes that inherit from a base class. This is because the only difference between the classes are the property names in Cosmos. The business logic is done by using the base class object.
The following reproduces the issue
I believe the JsonProperty attributes should be read from the ChildClass in the scenario above.
Instead, it's using the parent's JsonProperty value and translates it to
my_custom_parent_name
instead ofmy_custom_child_name
. The Name2 property that is not overriding anything works as expectedThe above is using
Newtonsoft.Json
. Switching it to useSystem.Text.Json.Serialization
:This results in no translation at all - the test result shows
SELECT VALUE root FROM root WHERE ((root["Name"] = "test") AND (root["Name2"] = "test2"))
I tried
Microsoft.Azure.Cosmos
3.37.1 and 3.41.0The alternative I have right now is to execute direct SQL text instead
The text was updated successfully, but these errors were encountered: