src/AspNetCore/Identity/Identity/src/AccountManaging/Controllers/IMvcBuilderAccountControllerExtensions.cs
/// <summary>
/// <para>
/// Adds default user/role converters as singletons to the services.
/// </para>
/// <para>
/// Registers the non-auto-discovered and default <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>
/// <param name="mvcBuilder"></param>
/// <param name="configureControllerModel"></param>
/// <returns></returns>
Adds default user/role converters as singletons to the services.

Registers the non-auto-discovered and default
to .

Adds default route "api/account" by adding a  to .
You can override it by providing a  yourself and enable forced default route.
Adds default user / role converters as singletons to the services . Registers the non - auto - discovered and default 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 IMvcBuilder AddAccountControllers(this IMvcBuilder mvcBuilder, Action<ISelectedControllerModelConfiguration>? configureControllerModel = null)
        {
            var services = mvcBuilder.Services;
            services.AddSingleton<IConvertUserDescriptor<UserDescriptorDatatransject, UserEntity>, UserDescriptorUserConverter>();
            services.AddSingleton<IConvertUser<UserEntity, UserCreationDatatransject>, UserUserCreationConverter>();
            services.AddSingleton<IConvertRoleDescriptor<RoleDescriptorDatatransject, RoleEntity>, RoleDescriptorRoleConverter>();
            services.AddSingleton<IConvertRole<RoleEntity, RoleCreationDatatransject>, RoleRoleCreationConverter>();
            mvcBuilder.AddAccountControllers<UserDescriptorDatatransject, UserEntity, UserCreationDatatransject, RoleDescriptorDatatransject, RoleEntity, RoleCreationDatatransject>(
                configureControllerModel: configureControllerModel);
            return mvcBuilder;
        }
public static IMvcBuilder AddAccountControllers ( this IMvcBuilder mvcBuilder , Action < ISelectedControllerModelConfiguration > ? configureControllerModel = null ) { var services = mvcBuilder . Services ; services . AddSingleton < IConvertUserDescriptor < UserDescriptorDatatransject , UserEntity > , UserDescriptorUserConverter > ( ) ; services . AddSingleton < IConvertUser < UserEntity , UserCreationDatatransject > , UserUserCreationConverter > ( ) ; services . AddSingleton < IConvertRoleDescriptor < RoleDescriptorDatatransject , RoleEntity > , RoleDescriptorRoleConverter > ( ) ; services . AddSingleton < IConvertRole < RoleEntity , RoleCreationDatatransject > , RoleRoleCreationConverter > ( ) ; mvcBuilder . AddAccountControllers < UserDescriptorDatatransject , UserEntity , UserCreationDatatransject , RoleDescriptorDatatransject , RoleEntity , RoleCreationDatatransject > ( configureControllerModel : configureControllerModel ) ; return mvcBuilder ; }
Adds default user/role converters as singletons to the services.
Adds default user / role converters as singletons to the services .
None
IMvcBuilder
this
configureControllerModel
Action<ISelectedControllerModelConfiguration>?
None
mvcBuilder
None