Beispiel #1
0
        /// <summary>
        /// Main entry funciton
        /// </summary>
        /// <param name="args">command line args</param>
        static void Main(string[] args)
        {
            // initial resolutions
            ISingleton s = Program.GetContainer().Resolve <ISingleton>();
            IMathFunc  m = Program.GetContainer().Resolve <IMathFunc>();

            s.SetVal(m.MathFunc(1.1, 2.2).ToString());
            s = null;

            // test singleton
            s = Program.GetContainer().Resolve <ISingleton>();
            Console.WriteLine(string.Format("Singleton value: {0} (should be 3.3)", s.GetVal()));
            Console.ReadLine();
        }