Created
September 4, 2015 11:45
-
-
Save OdeToCode/5a70eed9f0e2dcdacb35 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| { | |
| public Foo(int value) | |
| { | |
| _value = value; | |
| } | |
| int _value; | |
| } | |
| public class Bar | |
| { | |
| public Bar(Foo foo) | |
| { | |
| _foo = foo; | |
| } | |
| Foo _foo; | |
| } | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var container = new Container(); | |
| container.Configure(c => | |
| { | |
| c.For<Foo>().Use<Foo>().Ctor<int>().Is(3); | |
| }); | |
| var bar = container.GetInstance<Bar>(); | |
| Console.WriteLine("Done!"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment