Last active
August 21, 2017 12:27
-
-
Save insightcoder/0b4245e8f0ed76a402a6bda311747dba to your computer and use it in GitHub Desktop.
IC314.04
https://www.insightcoder.com/314/how-angular2-corrected-my-understanding-of-dependency-injection/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Foo : IFoo | |
{ | |
private IBar _bar; | |
public Foo(IBar bar) | |
{ | |
_bar = bar; | |
} | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
public static int Main(string[] args) | |
{ | |
var foo = IocContainer.Resolve<IFoo>(); | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment