Esempio n. 1
0
        public object GetRequiredService(Type type)
        {
            IServiceCache service = null;

            if (!_cache.TryGetValue(type, out service))
            {
                throw new Exception("获取参数对象没有注入");
            }
            return(service.GetCache(_cache));
        }
Esempio n. 2
0
        public T GetRequiredService <T>()
        {
            Type          t       = typeof(T);
            IServiceCache service = null;

            if (!_cache.TryGetValue(t, out service))
            {
                throw new Exception("获取参数对象没有注入");
            }
            return((T)service.GetCache(_cache));
        }