public void Something() { // you can use the factory here safely // but the actual provider is configured elsewhere FooFactory factory = new FooFactory(); IFoo foo = factory.CreateFoo(); }
public void Example() { var c = new Container(); c.Register <Repo>(); c.Register <IFoo>(made: Made.Of(() => FooFactory.CreateFoo(Arg.Of <Repo>()))); Assert.IsNotNull(c.Resolve <IFoo>()); }