samedi 20 mai 2017

Use MEF to gather items to register in my Ioc container

I'm using.Net 4.6.2 with Microsoft DI. I want to register all items that implement a specific interface in my IOC. I was thinking of using MEF to gather all the items that implement an interface, loop through them and add them to my IOC. My concern is that this is sort of a waste of effort, or double effort, sort of registering things twice. Should I really just use reflection to scan an assembly for every item that implements my interface and registering it that way? My thought was that using MEF would make things easier to maintain, ensuring any new items would automatically get registered.





Aucun commentaire:

Enregistrer un commentaire