Exemplo n.º 1
0
        void RunDIDemo()
        {
            ISayHello hello = new DIDemo(new ConsolePrinter()); //<- this is what you resolve from your container

            //...
            hello.SayHello("John");
        }
Exemplo n.º 2
0
        ISayHello getSayHello()
        {
            var clock = new UtcClock();
            var printer = new ConsolePrinterWithTime(clock, new ConsolePrinter());
            ISayHello hello = new DIDemo(printer);

            return hello;
        }
Exemplo n.º 3
0
        void RunDIDemo2()
        {
            var clock = new UtcClock();
            var printer = new ConsolePrinterWithTime(clock, new ConsolePrinter());
            ISayHello hello = new DIDemo(printer); //<- this is what you resolve from your container

            //......
            hello.SayHello("Tim");
        }