src/AspNetCore/Identity/Identity/src/AccountManaging/Controllers/IMvcBuilderAccountControllerExtensions.cs
/// <summary>
/// <para>
/// Registers the non-auto-discovered <see cref="AccountController{UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType}"/> 
/// to <see cref="IMvcBuilder"/>.
/// </para>
/// <para>
/// Adds default route "api/account" by adding a <see cref="SelectorRouteApplicableConvention"/> to <see cref="MvcOptions.Conventions"/>.
/// <br/>You can override it by providing a <see cref="SelectorRouteApplicableConvention"/> yourself and enable forced default route.
/// </para>
/// </summary>
/// <typeparam name="UserDescriptorType">Type of user descriptor.</typeparam>
/// <typeparam name="UserType">Type of user entity.</typeparam>
/// <typeparam name="UserCreationType">Type of user view.</typeparam>
/// <typeparam name="RoleDescriptorType">Type of role descriptor.</typeparam>
/// <typeparam name="RoleType">Type of role entity.</typeparam>
/// <typeparam name="RoleCreationType">Type of role view.</typeparam>
/// <param name="mvcBuilder">The MVC builder.</param>
/// <param name="configureControllerModel">Configures the controller.</param>
/// <returns></returns>
Registers the non-auto-discovered
to .

Adds default route "api/account" by adding a  to .
You can override it by providing a  yourself and enable forced default route.
Registers the non - auto - discovered to . Adds default route " api / account " by adding a to . You can override it by providing a yourself and enable forced default route .
public static AccountConfigurator<UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType> AddAccountControllers<UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>(
            this IMvcBuilder mvcBuilder, Action<ISelectedControllerModelConfiguration>? configureControllerModel = null)
            where UserDescriptorType : IUserDescriptor
            where UserType : IAccountUserEntity
            where RoleDescriptorType : IRoleDescriptor
        {
            var accountControllerTypeInfo = typeof(AccountController<UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>).GetTypeInfo();
            mvcBuilder.ConfigureApplicationPartManager(setup => {
                var applicationTypes = new[] {
                    accountControllerTypeInfo
                };
                var constrainedTypesProvider = new TypesProvidingApplicationPart(applicationTypes);
                setup.ApplicationParts.Add(constrainedTypesProvider);
            });
            var controllerModelConfiguration = new ControllerModelConfiguration(accountControllerTypeInfo);
            controllerModelConfiguration.AddSelectorRouteConventionToSelectedController("api/account",
                (configuration, convention) => configuration.AddControllerConvention(convention));
            configureControllerModel?.Invoke(controllerModelConfiguration);
            mvcBuilder.Services.ApplyControllerModelConfiguration(controllerModelConfiguration);
            return new AccountConfigurator<UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>(mvcBuilder);
        }
public static AccountConfigurator < UserDescriptorType , UserType , UserCreationType , RoleDescriptorType , RoleType , RoleCreationType > AddAccountControllers < UserDescriptorType , UserType , UserCreationType , RoleDescriptorType , RoleType , RoleCreationType > ( this IMvcBuilder mvcBuilder , Action < ISelectedControllerModelConfiguration > ? configureControllerModel = null ) where UserDescriptorType : IUserDescriptor where UserType : IAccountUserEntity where RoleDescriptorType : IRoleDescriptor { var accountControllerTypeInfo = typeof ( AccountController < UserDescriptorType , UserType , UserCreationType , RoleDescriptorType , RoleType , RoleCreationType > ) . GetTypeInfo ( ) ; mvcBuilder . ConfigureApplicationPartManager ( setup => { var applicationTypes = new [ ] { accountControllerTypeInfo } ; var constrainedTypesProvider = new TypesProvidingApplicationPart ( applicationTypes ) ; setup . ApplicationParts . Add ( constrainedTypesProvider ) ; } ) ; var controllerModelConfiguration = new ControllerModelConfiguration ( accountControllerTypeInfo ) ; controllerModelConfiguration . AddSelectorRouteConventionToSelectedController ( " " , ( configuration , convention ) => configuration . AddControllerConvention ( convention ) ) ; configureControllerModel ? . Invoke ( controllerModelConfiguration ) ; mvcBuilder . Services . ApplyControllerModelConfiguration ( controllerModelConfiguration ) ; return new AccountConfigurator < UserDescriptorType , UserType , UserCreationType , RoleDescriptorType , RoleType , RoleCreationType > ( mvcBuilder ) ; }
Registers the non-auto-discovered
to .
Registers the non - auto - discovered to .
None
IMvcBuilder
this
configureControllerModel
Action<ISelectedControllerModelConfiguration>?
Configures the controller.
Configures the controller .
mvcBuilder
The MVC builder.
The MVC builder .
typeparam
Type of user descriptor.
Type of user descriptor .
typeparam
Type of user entity.
Type of user entity .
typeparam
Type of user view.
Type of user view .
typeparam
Type of role descriptor.
Type of role descriptor .
typeparam
Type of role entity.
Type of role entity .
typeparam
Type of role view.
Type of role view .