public DynamicRouteConfiguration(string controllerName, string actionName, string viewName, Type modelType, DynamicRouteType routeType) { ViewName = viewName; ModelType = modelType; RouteType = routeType; // Adjust based on Route Type switch (RouteType) { case DynamicRouteType.View: ControllerName = "DynamicRoute"; ActionName = "RenderView"; break; case DynamicRouteType.ViewWithModel: ControllerName = "DynamicRoute"; ActionName = "RenderViewWithModel"; break; case DynamicRouteType.Controller: default: ControllerName = controllerName; ActionName = actionName; break; } }
public DynamicRouteConfiguration(string controllerName, string actionName, string viewName, Type modelType, DynamicRouteType routeType, bool includeDocumentInOutputCache, bool useOutputCaching) { ViewName = viewName; ModelType = modelType; RouteType = routeType; IncludeDocumentInOutputCache = includeDocumentInOutputCache; // Adjust based on Route Type switch (RouteType) { case DynamicRouteType.View: ControllerName = "DynamicRoute" + (useOutputCaching ? "Cached" : ""); ActionName = "RenderView"; UseOutputCaching = useOutputCaching; break; case DynamicRouteType.ViewWithModel: ControllerName = "DynamicRoute" + (useOutputCaching ? "Cached" : ""); ActionName = "RenderViewWithModel"; UseOutputCaching = useOutputCaching; break; case DynamicRouteType.Controller: default: ControllerName = controllerName; ActionName = actionName; UseOutputCaching = false; break; } RouteValues = new Dictionary <string, object>(); }