Domain Class with injected service

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Domain Class with injected service

George Smith
Is there some valid reason that I should not be injecting services into a domain class.

I wish to be able to use the mailService to send an email if someone deletes a record using the beforeDelete event. It seems to work just fine, but Codenarc has a rule violation when it finds this situation. So, I'm wondering if someone knows something that I don't know. I'm sure that that is easily the case but wondered what the dev team thinks.