mdissel wrote:
of course .. change the templates.. Thanks!
It's not only the templates, but also your code: you can't do this anymore:
var newCustomer = new CustomerEntity();
because an external DI framework won't be called that way. You have to use the factory of the DI framework you're using for this.
There's another way, I didn't think of that. see below.
Why? because all our customers wants different validations and different authorizations.. We have default behaviour that can be overriden for each customer.
We don't want to change the config files to change the behaviour but just copy a DLL that will contain the customisations..
Our DI system can do that. It has an automated discovery system: just specify that you want autodiscovery and it finds the di assemblies. If you use a website, you need to specify the assembly, but you could keep that the same name.
You can also use a scope, setup in the application startup.
Why not add a simple interface that's callled to resolve the classes? Out of the box the default implementation is used, but you can create your own implementation (and use your own DI framework).
You can do that, override PerformDependencyInjection in a partial class of CommonEntityBase. In there call your DI framework of choice (or your own code). By default it calls our own engine.