Replies: 1 comment
-
At the moment there isn't. But you're always free to send in a fully tested PR adding this feature! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way I can run code after a DTO is created? I want to automatically evaluate some data based on the contents of a DTO. The DTO is created in different places (e.g. update and store routes) and I don't want to repeat the code.
Would be very handy to have a function in the DTO called something like
postCreate
that gets called after the DTO has been created and its properties have been set.From what I've seen the current way to achieve this is to do it via constructor properties and that gets ugly with larger DTOs.
Update:
We managed to hack around this by registering our own binding for the
DataFromArrayResolver
where we've overridden theexecute
function to call its parent for the actual work and then check for presence of apostCreate
function and call that if present. It is an extremely hacky solution and it would be great if we could just replace the DataFromArrayResolver via config.Beta Was this translation helpful? Give feedback.
All reactions