public InjectorContextBuilder Add(string name, object obj) { AttributeHelper.CheckCorrectCall <ContextConfiguableMethod>(); var type = obj.GetType(); nameDictionary[name] = obj; if (!anonymousObjectTypeSet.Contains(type)) { typeDictionary[type] = obj; } return(this); }
public InjectorContextBuilder Add(object obj) { AttributeHelper.CheckCorrectCall <ContextConfiguableMethod>(); var type = obj.GetType(); if (anonymousObjectTypeSet.Contains(type)) { throw new DuplicatedObjectException(type); } typeDictionary[type] = obj; anonymousObjectTypeSet.Add(type); return(this); }