Example #1
0
    static void Main(string[] args)
    {
      IUnityContainer container = new UnityContainer();
      var cache = new SimpleMemoryCache();
      container.RegisterType<Tenant>(new CachedLifetimeManager(cache));
      var tenant = container.Resolve<Tenant>();
      var tenant2 = container.Resolve<Tenant>();

      Console.ReadLine();
    }
Example #2
0
        static void Main(string[] args)
        {
            IUnityContainer container = new UnityContainer();
            var             cache     = new SimpleMemoryCache();

            container.RegisterType <Tenant>(new CachedLifetimeManager(cache));
            var tenant  = container.Resolve <Tenant>();
            var tenant2 = container.Resolve <Tenant>();

            Console.ReadLine();
        }