Skip to content
This repository was archived by the owner on Nov 2, 2018. It is now read-only.

Conversation

@yufeih
Copy link

@yufeih yufeih commented Mar 24, 2017

  • Singleton uses same instance when registered with different service types
  • Scoped instances are same within a scope but are different across scopes
  • Singleton instances are disposed exactly once

#360

@dnfclas
Copy link

dnfclas commented Mar 24, 2017

@yufeih,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@yufeih yufeih changed the title Different singleton registrations resolve to same instance (#360) Different singleton registrations resolve to same instance (https://github.com/aspnet/DependencyInjection/issues/360) Mar 24, 2017
@yufeih yufeih changed the title Different singleton registrations resolve to same instance (https://github.com/aspnet/DependencyInjection/issues/360) Different singleton registrations resolve to same instance Mar 24, 2017
@davidfowl
Copy link
Member

davidfowl commented Mar 24, 2017

This is a breaking change. If we decide to support this, I'm not sure we can just break the existing behavior. It may need to be a different registration syntax

@yufeih
Copy link
Author

yufeih commented Mar 24, 2017

I see, like services.AddSingleton<IBar, IBaz, Bar>();

@Eilon
Copy link
Contributor

Eilon commented Mar 27, 2017

Closing per #360 (comment)

@Eilon Eilon closed this Mar 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants