public static object Get(this IGetKernel kernel, Type type) { // Binding should inject - for singletons, consts, etc. var binding = kernel.GetBinding(type); if (binding == null) { throw new InvalidOperationException("Can't Get: " + type + " no binding found"); } return(binding(kernel)); }
/// <summary> /// Returns binding for argument /// </summary> private static Binding GetArgBinding(this IGetKernel kernel, Type type, string name) { return(kernel.GetOverrideBinding(type, name) ?? kernel.GetBinding(type)); }
public static bool CanBind(this IGetKernel kernel, Type type) { return(kernel.GetBinding(type) != null); }