Skip to content

Instantly share code, notes, and snippets.

@OdeToCode
Created September 4, 2015 11:45
Show Gist options
  • Select an option

  • Save OdeToCode/5a70eed9f0e2dcdacb35 to your computer and use it in GitHub Desktop.

Select an option

Save OdeToCode/5a70eed9f0e2dcdacb35 to your computer and use it in GitHub Desktop.
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