Skip to content
Discussion options

You must be logged in to vote

This sounds more like an architecture problem, why you can't control injection and must call it multiple times in the first place? That is odd in the first place. But if you must do that, the workaround you mentioned is kind of fine, although, you can make [Inject] methods instead of read-only fields and check inside them if a local field already has that dependency injected or not (at least, in your case, the responsibility to handle multiple calls of injection is fairly belongs to the class that gets injected with dependencies).

Btw the process of injection itself takes minimal amount of hardware resources, with what you have it won't be noticeable on any platform. But still, the way it…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kenofori
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants