예제 #1
0
        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));
        }
예제 #2
0
 public ISimpleContainer Register(TypeRegistration registration)
 {
     this.Registry.Insert(registration);
     return(this);
 }