public static BindingBuilder <T> InSingletonScope <T>(this BindingBuilder <T> builder) { builder.CheckBound(true); var binding = new SingletonBinding(builder.Binding); return(builder.SetBinding(binding.Get)); }
public static BindingBuilder <T> ToMethod <T>(this BindingBuilder <T> builder, Func <IGetKernel, T> method) { builder.CheckBound(false); return(builder.SetBinding(c => method(c))); }
public static void ToConstant <T>(this BindingBuilder <T> builder, T value) { builder.CheckBound(false); builder.SetBinding(c => value); }