-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Linq provider does not support custom property naming conventions. #125
Comments
Hi @roald-di, Thank you for spending time identifying the issue with the appropriate details. I really appreciate it. You're correct, adding another dependency on As far as guidance goes:
I think this approach avoids taking a hard dependency on I'm also open to other ideas, but that's how I would start. Let me know what you think. Hope that helps, PS. Protip: Run 💥 🔥 "Set it ablaze like a candle wick... Light it up, light it up..." |
I am using
snake_case_property_names
in my rethinkdb tables.While it is possible to configure the serializer to read the records in this format, it's not possible to generate queries with the linq provider that follow the same naming convention.
So for example running
.Where(user => user.FirstName == "John")
will result in a query with a filter containing"FirstName"
instead of"first_name"
.The name used in the query is determined here:
RethinkDb.Driver/Source/RethinkDb.Driver.Linq/MemberNameResolver.cs
Line 28 in 059c7e9
I think that maybe this could be extended to get the name from the ContractResolver configured on
RethinkDb.Driver.Net.Converter.Serializer
or theJsonPropertyAttribute
if present.However I'm not sure if introducing another dependency on Newtosoft.Json is a good idea given this issue: #33
I am willing to work on a PR if I can get some guidance on the design.
The text was updated successfully, but these errors were encountered: