Exemplo n.º 1
0
 /// <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);
             }
         }
     }
 }
Exemplo n.º 3
0
 public static MvcRouteGenerator CreateGenerator(MvcController controller, string baseUrl)
 {
     return(new AspNetCoreRouteGenerator(controller, baseUrl));
 }
Exemplo n.º 4
0
 protected MvcRouteGenerator(MvcController controller, string baseUrl)
 {
     _baseUrl   = baseUrl;
     Controller = controller;
 }