public static object GetArg(this IGetKernel kernel, Type type, string name) { var binding = kernel.GetArgBinding(type, name); if (binding == null) { throw new InvalidOperationException("Can't GetArg: " + type + " for arg " + name + " no binding found"); } return(binding(kernel)); }
public static bool CanBindArg(this IGetKernel kernel, Type type, string name) { return(kernel.GetArgBinding(type, name) != null); }