private void ConfigureSelector(ControllerModel controller, AutoApiAttribute attribute) { if (controller.Selectors.Any(selector => selector.AttributeRouteModel != null)) { return; } var areaName = string.Empty; if (attribute != null) { areaName = attribute.AreaName; } foreach (var action in controller.Actions) { ConfigureSelector(areaName, controller.ControllerName, action); } }
private void ConfigureArea(ControllerModel controller, AutoApiAttribute attribute) { if (attribute == null) { throw new ArgumentException(nameof(attribute)); } if (!controller.RouteValues.ContainsKey("area")) { if (!string.IsNullOrEmpty(attribute.AreaName)) { controller.RouteValues["area"] = attribute.AreaName; } else if (!string.IsNullOrEmpty(PlusConsts.DefaultAreaName)) { controller.RouteValues["area"] = PlusConsts.DefaultAreaName; } } }
private void ConfigureAutoApi(ControllerModel controller, AutoApiAttribute attribute) { ConfigureApiExplorer(controller); ConfigureSelector(controller, attribute); ConfigureParameters(controller); }