示例#1
0
 public void MapInfo(Type type, InjectSetting setting)
 {
     if (!_typeCache.ContainsKey(type))
     {
         _typeCache.Add(type, setting);
     }
 }
示例#2
0
        public void Map2(Type bind, Lifetime scope)
        {
            if (!_typeCache.ContainsKey(bind))
            {
                var val = _typeCache[bind];
                if (val == null)
                {
                    val = new InjectSetting {
                        Bind = bind
                    };
                }

                val.Scope = scope;
            }
        }
示例#3
0
        public void Map1(Type bind, Type to)
        {
            if (_typeCache.ContainsKey(bind))
            {
                var val = _typeCache[bind];
                if (val == null)
                {
                    val = new InjectSetting {
                        Bind = bind, Scope = Lifetime.Singleton
                    };
                }

                val.To = to;
            }
        }