public static ISimpleContainer RegisterMethod <T>(this ISimpleContainer container, Func <ISimpleContainer, T> method) { var key = new TypeRegistrationKey(typeof(T), null); var registration = new TypeRegistration(key, typeof(T), new SingletonLifetime(), c => method.Invoke(c)); return(container.Register(registration)); }
public ISimpleContainer Register(TypeRegistration registration) { this.Registry.Insert(registration); return(this); }