Ejemplo n.º 1
0
        private void Add()
        {
            using (var scope = _container.BeginLifetimeScope())
            {
                _addClassWithRefit = scope.Resolve<AddClassWithRefit>();
                _addClassWithoutRefit = scope.Resolve<AddClassWithoutRefit>();

                var result = _addClassWithoutRefit.Add(5, 10);
                Console.WriteLine("Without refit: " + result);
                Console.ReadLine();

                result = _addClassWithRefit.Add(5, 10);
                Console.WriteLine("With refit: " + result);
                Console.ReadLine();
            }
        }
Ejemplo n.º 2
0
        private void Add()
        {
            using (var scope = _container.BeginLifetimeScope())
            {
                _addClassWithRefit    = scope.Resolve <AddClassWithRefit>();
                _addClassWithoutRefit = scope.Resolve <AddClassWithoutRefit>();

                var result = _addClassWithoutRefit.Add(5, 10);
                Console.WriteLine("Without refit: " + result);
                Console.ReadLine();

                result = _addClassWithRefit.Add(5, 10);
                Console.WriteLine("With refit: " + result);
                Console.ReadLine();
            }
        }