src/AspNetCore/Identity/Identity/src/AccountManaging/Controllers/IMvcBuilderAccountControllerExtensions.cs
/// <summary>
/// <para>
/// Adds the user/role converters as singletons to the services.
/// </para>
/// <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"></param>
/// <param name="userDescriptorUserConverter"></param>
/// <param name="userUserCreationConverter"></param>
/// <param name="roleDescriptorRoleConverter"></param>
/// <param name="roleRoleCreationConverter"></param>
/// <param name="configureControllerModel"></param>
/// <returns></returns>
Adds the user/role converters as singletons to the services.

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.
Adds the user / role converters as singletons to the services . 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> AddAccountControllersWithConverters<UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>(
            this IMvcBuilder mvcBuilder,
            IConvertUserDescriptor<UserDescriptorType, UserType> userDescriptorUserConverter, IConvertUser<UserType, UserCreationType> userUserCreationConverter,
            IConvertRoleDescriptor<RoleDescriptorType, RoleType> roleDescriptorRoleConverter, IConvertRole<RoleType, RoleCreationType> roleRoleCreationConverter,
            Action<ISelectedControllerModelConfiguration>? configureControllerModel = null)
            where UserDescriptorType : IUserDescriptor
            where UserType : IAccountUserEntity
            where RoleDescriptorType : IRoleDescriptor
        {
            var services = mvcBuilder.Services;
            services.AddSingleton(userDescriptorUserConverter);
            services.AddSingleton(userUserCreationConverter);
            services.AddSingleton(roleDescriptorRoleConverter);
            services.AddSingleton(roleRoleCreationConverter);
            var builder = mvcBuilder.AddAccountControllers<UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>(
                configureControllerModel: configureControllerModel);
            return builder;
        }
public static AccountConfigurator < UserDescriptorType , UserType , UserCreationType , RoleDescriptorType , RoleType , RoleCreationType > AddAccountControllersWithConverters < UserDescriptorType , UserType , UserCreationType , RoleDescriptorType , RoleType , RoleCreationType > ( this IMvcBuilder mvcBuilder , IConvertUserDescriptor < UserDescriptorType , UserType > userDescriptorUserConverter , IConvertUser < UserType , UserCreationType > userUserCreationConverter , IConvertRoleDescriptor < RoleDescriptorType , RoleType > roleDescriptorRoleConverter , IConvertRole < RoleType , RoleCreationType > roleRoleCreationConverter , Action < ISelectedControllerModelConfiguration > ? configureControllerModel = null ) where UserDescriptorType : IUserDescriptor where UserType : IAccountUserEntity where RoleDescriptorType : IRoleDescriptor { var services = mvcBuilder . Services ; services . AddSingleton ( userDescriptorUserConverter ) ; services . AddSingleton ( userUserCreationConverter ) ; services . AddSingleton ( roleDescriptorRoleConverter ) ; services . AddSingleton ( roleRoleCreationConverter ) ; var builder = mvcBuilder . AddAccountControllers < UserDescriptorType , UserType , UserCreationType , RoleDescriptorType , RoleType , RoleCreationType > ( configureControllerModel : configureControllerModel ) ; return builder ; }
Adds the user/role converters as singletons to the services.
Adds the user / role converters as singletons to the services .
None
IMvcBuilder
this
userDescriptorUserConverter
IConvertUserDescriptor<UserDescriptorType, UserType>
None
userUserCreationConverter
IConvertUser<UserType, UserCreationType>
None
roleDescriptorRoleConverter
IConvertRoleDescriptor<RoleDescriptorType, RoleType>
None
roleRoleCreationConverter
IConvertRole<RoleType, RoleCreationType>
None
configureControllerModel
Action<ISelectedControllerModelConfiguration>?
None
mvcBuilder
None
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 .