Skip to content

Good progress on CSLA6 using DI and FactoryObjects - but troublesome service registration #2684

Discussion options

You must be logged in to vote

Question 1
I have already written code to do inspection and auto-registration of types in an assembly, so yes, it is very possible to do so. I wrote it to do fairly generic convention-over-configuration type registrations, such as registering MyTypeRepository as the implementation of IMyTypeRepository by finding all of the classes with names that ended with the word 'Repository' from a specific assembly.

I haven't shared that code yet because I'm not sure it's production grade yet, but I probably will do so at some point. It uses reflection at app startup. I did it that way because I want to define the rules for what gets registered, to reduce the potential for it introducing a security v…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@TheCakeMonster
Comment options

@swegele
Comment options

swegele Feb 16, 2022
Collaborator Author

@TheCakeMonster
Comment options

Answer selected by swegele
Comment options

You must be logged in to vote
1 reply
@swegele
Comment options

swegele Jan 8, 2022
Collaborator Author

Comment options

swegele
Feb 17, 2022
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants