public T _bean <T>(Type t, string name = BeanAttribute.DEFAULT) { if (map.ContainsKey(t)) { Dictionary <string, Bean> beanMap = map[t]; if (beanMap.ContainsKey(name)) { Bean b = beanMap[name]; T ans = b.getBean <T>(); if (ans != null) { return(ans); } } } if (findFunc != null) { return((T)findFunc.findBean(t, name)); } throw new NullReferenceException("not find this bean t=" + t + " name=" + name); }