You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In essence, several DI containers provide functionality allowing consumers to have an IEnumerable be injected. The expected behaviour is for the container to find all registered implementations assignable from IService.
I believe @mattridgway would like to introduce an observable variant which would allow consumers to subscribe for notifications of new services (assignable from IService) being registered.
Personally, I would like to see an extension that the Host projects can use to mark a service as Transitional (possibly separate from existing extensions), which would allow our IEnumerable implementation to append new services so that the next enumeration would yield both original and new services.
The text was updated successfully, but these errors were encountered:
Regarding my personal preference on implementation, a potential downside would be if the consumer calls "ToList", the behaviour I described would obviously be no longer available.
Perhaps there is merit in defining a custom INamedEnumerable? That way we could add an overriding "ToList" extension that continues the described behaviour and does not allow Add/Update operations? (Sounds horrid, but bad idea > no idea).
I think if someone was doing this they should be informed enough to know they are caching the results and ignoring any potential amendments. I actually dont see this as a huge negative. Just something to bear in mind
This behaviour needs further discussion @mattridgway / @AdamWilks et al.
In essence, several DI containers provide functionality allowing consumers to have an IEnumerable be injected. The expected behaviour is for the container to find all registered implementations assignable from IService.
I believe @mattridgway would like to introduce an observable variant which would allow consumers to subscribe for notifications of new services (assignable from IService) being registered.
Personally, I would like to see an extension that the Host projects can use to mark a service as Transitional (possibly separate from existing extensions), which would allow our IEnumerable implementation to append new services so that the next enumeration would yield both original and new services.
The text was updated successfully, but these errors were encountered: