public IocContainer Instance <T>(T obj) { string key = typeof(T).Name; _cache[key] = new IocCacheData(true) { TargetType = typeof(T), Key = key, Instance = obj }; return(this); }
private void Register <T>(string key, bool singleton) { Type targetType = typeof(T); if (string.IsNullOrEmpty(key)) { key = GetDefaultName(targetType); } _cache[key] = new IocCacheData(singleton) { TargetType = targetType, Key = key }; }