/// <summary> /// Creates a new action info from the given method /// </summary> /// <param name="method">the method</param> /// <param name="typeFactory">The type table</param> internal MvcAction(MvcController controller, IMethod method, TypeFactory typeFactory) { Controller = controller; Method = method; _typeFactory = typeFactory; ScriptName = GetScriptName(method, typeFactory.Settings.NamingStrategy); ReturnType = typeFactory.LookupType(method.ReturnType); ParameterComments = method.Parameters.ToDictionary(param => param.Name, param => param.Comments); ActionParameters = method.Parameters.Select(p => new MvcActionParameter(this, p, typeFactory)).ToList().AsReadOnly(); }
private void EnsureCompiledControllers() { if (_controllers == null) { _controllers = new List <MvcController>(); foreach (INamedType controllerType in _controllerTypes.Values) { MvcController controllerInfo = new MvcController(controllerType, CommonFilters.ScriptActionAttributeTypeFilter, _typeFactory); if (controllerInfo.Actions.Count > 0) { _controllers.Add(controllerInfo); } } } }
public static MvcRouteGenerator CreateGenerator(MvcController controller, string baseUrl) { return(new AspNetCoreRouteGenerator(controller, baseUrl)); }
protected MvcRouteGenerator(MvcController controller, string baseUrl) { _baseUrl = baseUrl; Controller = controller; }