public ApiControllerInfo RegisterControllerType(Type controllerType, string routePrefix = null) { var info = new ApiControllerInfo(null, controllerType, routePrefix); ControllerInfos.Add(info); return(info); }
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); }
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); }
public ApiControllerInfo RegisterControllerType(Type controllerType, string routePrefix = null) { var info = new ApiControllerInfo(null, controllerType, routePrefix); ControllerInfos.Add(info); return info; }