Esempio n. 1
0
        ISayHello getSayHello()
        {
            var clock = new UtcClock();
            var printer = new ConsolePrinterWithTime(clock, new ConsolePrinter());
            ISayHello hello = new DIDemo(printer);

            return hello;
        }
Esempio n. 2
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");
        }