src/AspNetCore/Mvc/Mvc/src/ControllerAssistance{`1}.cs
/// <summary>
/// Adds a default controller route to controller model but provides callback to customize controller model.
/// </summary>
/// <returns></returns>
Adds a default controller route to controller model but provides callback to customize controller model.
Adds a default controller route to controller model but provides callback to customize controller model .
public ControllerAssistance<T> HasDefaultRoute(
            string defaultRoute,
            Action<ISelectedControllerModelConfiguration>? configureControllerModel = null)
        {
            var controllerModelConfiguration = new ControllerModelConfiguration(ControllerTypeInfo);
            controllerModelConfiguration.AddSelectorRouteConventionToSelectedController(defaultRoute,
                (configuration, convention) => configuration.AddControllerConvention(convention));
            configureControllerModel?.Invoke(controllerModelConfiguration);
            MvcBuilder.Services.ApplyControllerModelConfiguration(controllerModelConfiguration);
            return this;
        }
public ControllerAssistance < T > HasDefaultRoute ( string defaultRoute , Action < ISelectedControllerModelConfiguration > ? configureControllerModel = null ) { var controllerModelConfiguration = new ControllerModelConfiguration ( ControllerTypeInfo ) ; controllerModelConfiguration . AddSelectorRouteConventionToSelectedController ( defaultRoute , ( configuration , convention ) => configuration . AddControllerConvention ( convention ) ) ; configureControllerModel ? . Invoke ( controllerModelConfiguration ) ; MvcBuilder . Services . ApplyControllerModelConfiguration ( controllerModelConfiguration ) ; return this ; }
Adds a default controller route to controller model but provides callback to customize controller model.
Adds a default controller route to controller model but provides callback to customize controller model .
None
defaultRoute
string
configureControllerModel
Action<ISelectedControllerModelConfiguration>?