Let CreateInstance/CreateSet directly work on a matching constructor instead of relying on public fields or properties #457
AroglDarthu
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
I implemented a workaround for now, which is quite easy to make, but it feels a bit convoluted.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
This is interesting. I haven't considered that, but that would be a good use-case. Could you please try to make something in a prototype-level first and send it as a draft PR, so that we can see the potential issues and see how the naming and the API should look like. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a situation where my support model looks like this (reason for this setup is that I also need specific json serialization/deserialization):
The CreateInstance helper correctly identifies the constructor and my table has the three columns which match the constructor parameters.
However, the helper does not directly map from the table to these parameters. It expects public properties (or fields) to be available as well and then fills in the constructor parameters based on these properties.
So in my case only the ModifiedAt gets a value, although all data is available in the table.
I would be happy to contribute a PR for this feature. Please let me know if this feature fits your views around the table helpers, specificly
CreateTheInstanceWithTheValuesFromTheTable
.Beta Was this translation helpful? Give feedback.
All reactions