Ejemplo n.º 1
0
        public static object GetDefault(this IGetKernel kernel, Type type)
        {
            var binding = kernel.GetDefaultBinding(type);

            if (binding == null)
            {
                throw new InvalidOperationException("Can't GetDefault: " + type + " no default binding found");
            }
            return(binding(kernel));
        }
Ejemplo n.º 2
0
 public static Binding GetBinding(this IGetKernel kernel, Type type)
 {
     // user binding has priority
     return(kernel.Root.GetUserBinding(type) ?? kernel.GetDefaultBinding(type));
 }