Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active March 16, 2020 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/2ff079e425e14fa7a482fa54d331ecdd to your computer and use it in GitHub Desktop.
Save ankitvijay/2ff079e425e14fa7a482fa54d331ecdd to your computer and use it in GitHub Desktop.
Captive Dependency 2
public class SingletonDependency
{
private readonly ScopedDependency scopedDepdendency;
// Should this blow up??
public SingletonDependency(ScopedDependency transitiveDependecy)
{
this.scopedDepdendency = transitiveDependecy;
}
public int GetNextCounter()
{
return scopedDepdendency.GetNextCounter();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment