Пример #1
0
        public static BindingBuilder <T> InSingletonScope <T>(this BindingBuilder <T> builder)
        {
            builder.CheckBound(true);
            var binding = new SingletonBinding(builder.Binding);

            return(builder.SetBinding(binding.Get));
        }
Пример #2
0
 public static BindingBuilder <T> ToMethod <T>(this BindingBuilder <T> builder, Func <IGetKernel, T> method)
 {
     builder.CheckBound(false);
     return(builder.SetBinding(c => method(c)));
 }
Пример #3
0
 public static void ToConstant <T>(this BindingBuilder <T> builder, T value)
 {
     builder.CheckBound(false);
     builder.SetBinding(c => value);
 }