Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ReadOnlyCollection<T> #762

Closed
dotnetjunkie opened this issue Oct 12, 2019 · 1 comment
Closed

Support ReadOnlyCollection<T> #762

dotnetjunkie opened this issue Oct 12, 2019 · 1 comment

Comments

@dotnetjunkie
Copy link
Collaborator

Simple Injector supports all kinds of collections, but does not natively understand ReadOnlyCollection<T>. As ReadOnlyCollection<T> only has one constructor, Simple Injector v4 is able to construct the type and will inject a supported IList<T>, but this makes the ReadOnlyCollection<T> Transient, which could easily cause lifestyle mismatches.

Besides supporting the concrete type Collection<T>, Simple Injector should be able to inject a singleton ReadOnlyCollection<T> as well.

@dotnetjunkie dotnetjunkie added this to the v4.8 milestone Oct 12, 2019
@dotnetjunkie dotnetjunkie modified the milestones: v4.8, v4.9 Nov 17, 2019
@dotnetjunkie
Copy link
Collaborator Author

feature-762 branch created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant