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(); } }
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(); } }