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