public static void AddTransient <T>(Func <T> creator) { var item = new ContainerItem <T>(IocMode.Transient, creator); AddItem(typeof(T), item); }
public static void AddSingleton <T>(Func <T> creator) { var item = new ContainerItem <T>(IocMode.Singleton, creator); AddItem(typeof(T), item); }
public static void AddTransient <T, TImpl>() where TImpl : T, new() { var item = new ContainerItem <TImpl>(IocMode.Transient, () => new TImpl()); AddItem(typeof(T), item); }
public static void AddSingleton <T>(T instance) { var item = new ContainerItem <T>(instance); AddItem(typeof(T), item); }