コード例 #1
0
    public string SayHelloWithABar(IBar bar)
    {
        IFoo foo = _fooFactory.CreateFoo(bar);

        // do something with your 'foo' instance ...
        return("hello!");
    }
コード例 #2
0
 public NeedsFooAtRuntime(IFooFactory factory)
 {
     this.foo = factory.CreateFoo("test");
 }
コード例 #3
0
 public void DoSomething()
 {
     var foo = fooFactory.CreateFoo();
     //Do whatever with foo
     //Your foo is now injected with another service and settings too:)
 }