示例#1
0
        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));
        }
示例#2
0
 public static bool CanBindArg(this IGetKernel kernel, Type type, string name)
 {
     return(kernel.GetArgBinding(type, name) != null);
 }