WayneBrantley wrote:
I disagree. When the application loads, the DI scans your code and attaches itself to certain classes, etc. It is this attachment I would like to verify. By a simple 'listClassesAttachedTo', or something.
Unit tests - of course, but I generally do not run unit tests in production!
You mean: a customerentity is instantiated and you want to verify with code if the proper validator/auditor etc. is injected?
You can. Create a partial class of CommonEntityBase. In there you override PerformDependencyInjection() and FIRST call the base class.
After that call, the elements to inject should be there. So then you call a central class which does the verification and gets the entity instance and checks, based on a table or something, if the proper instances are injected.
So the override to PerformDependencyInjection is just 2 method calls: 1 to the base, and one to the verifyer.