Example #1
0
        public void Resolve()
        {
            var provider = new DependencyCollection()
                           .AddSingleton <JConverter>()
                           .AddSingleton <IMapper <Boo>, CompiledMapper <Boo> >()
                           .AddSingleton <IMapper <Foo>, CompiledMapper <Foo> >()
                           .AddSingleton <IConfiguration>(ctx => new Configuration())
                           .AddTransient <ISession, Session>()
                           .AddSingleton <IFooService, FooService>()
                           .AddSingleton <IFooRepository, FooRepository>()
                           .AddSingleton <IBooService, BooService>()
                           .AddSingleton <IBooRepository, BooRepository>()
                           .AddSingleton <SomethingController>()
                           .AddLogging()
                           .BuildProvider();

            var controller = provider.GetService <SomethingController>();

            Assert.NotNull(controller);
        }