Exemple #1
0
        public ApiControllerInfo RegisterControllerType(Type controllerType, string routePrefix = null)
        {
            var info = new ApiControllerInfo(null, controllerType, routePrefix);

            ControllerInfos.Add(info);
            return(info);
        }
Exemple #2
0
 public void RegisterController(object instance, string routePrefix = null)
 {
     Util.Check(instance != null, "Controller instance may not be null.");
       var controllerType = instance.GetType();
       //Check if it is a mistake - user is registering controller type; if yes, redirect to other method
       if(typeof(Type).IsAssignableFrom(controllerType)) {
     RegisterControllerType((Type)instance, routePrefix);
     return;
       }
       var info = new ApiControllerInfo(instance, controllerType, routePrefix);
       ControllerInfos.Add(info);
 }
Exemple #3
0
        public void RegisterController(object instance, string routePrefix = null)
        {
            Util.Check(instance != null, "Controller instance may not be null.");
            var controllerType = instance.GetType();

            //Check if it is a mistake - user is registering controller type; if yes, redirect to other method
            if (typeof(Type).IsAssignableFrom(controllerType))
            {
                RegisterControllerType((Type)instance, routePrefix);
                return;
            }
            var info = new ApiControllerInfo(instance, controllerType, routePrefix);

            ControllerInfos.Add(info);
        }
Exemple #4
0
 public ApiControllerInfo RegisterControllerType(Type controllerType, string routePrefix = null)
 {
     var info = new ApiControllerInfo(null, controllerType, routePrefix);
       ControllerInfos.Add(info);
       return info;
 }