GetServices<TService>() allocates a new instance of all transients when called #3

Open
opened 2025-09-24 02:17:26 +00:00 by REDCODE · 0 comments
Owner

Calling GetServices passing an interface as TService will net you a list of TService implementations, in case of singletons this is no big deal, but when we get to transient services this will return a fresh instance of all of them.

  • At very least a remark should be added to the XML docs warning about this.
  • Some sort of lazy initialization mechanism could be created
    • this mechanism should be easy to use
    • and absolutely not verbose

Not the highest priority right now, but good to keep in mind.

Calling GetServices passing an interface as TService will net you a list of TService implementations, in case of singletons this is no big deal, but when we get to transient services this will return a fresh instance of all of them. - [ ] At very least a remark should be added to the XML docs warning about this. - [ ] Some sort of lazy initialization mechanism could be created - [ ] this mechanism should be easy to use - [ ] and absolutely not verbose Not the highest priority right now, but good to keep in mind.
REDCODE added the
enhancement
label 2025-09-24 02:17:26 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: REDCODE/Syrette#3
No description provided.