public void RegisterSingleton <TInterface>(object value) { IOCException.CheckImplementedInterface <TInterface>(value.GetType()); if (IsRegisteredSingleton <TInterface>()) { singletonTable[typeof(TInterface)] = value; return; } singletonTable.Add(typeof(TInterface), value); }
public void Register <TInterface, TImplement>() { IOCException.CheckImplementedInterface <TInterface, TImplement>(); if (IsRegisteredImplement <TInterface>()) { interfaceTable[typeof(TInterface)] = typeof(TImplement); return; } interfaceTable.Add(typeof(TInterface), typeof(TImplement)); }