I love the benchmarks on LightInject; they are insane! Way to go, you should write a book on .Net performance, I'm serious.
I see the documentation.
I got the dll installed. Followed that step ok.
Then the next step of the documentation presumes I have a container
object.
container.Register<IFoo, Foo>();
var instance = container.GetInstance<IFoo>();
Assert.IsInstanceOfType(instance, typeof(Foo));
Whoops! I may not be the sharpest crayola in the box, granted, but what do I do now? What class and methods should I create to "set it up" so I can follow the rest of the examples? (I guess I better set it up so that it works in the whole project)
As an aside: Would it be wrong to add those steps in the doc at that point, if not explicitly, then by reference to other "man pages"? Maybe there are various ways of getting a container; I don't know enough to know which one I need. At this point in the documentation I was just looking for the "this will work in 90% of the situations" example, and links to more specialized cases.
Thanks!
DoStuff
in your IFoo, implement it in Foo and then call it:instance.DoStuff();
– Metallographycontainer
is not a class in LightInject? – Prismatoidvar container = new ServiceContainer();
See my updated answer. – Metallography