abp
abp copied to clipboard
When I override IdentityUserController,it raise routing issues
I want to override IdentityUserController and add my logic in methods,when I debug it raise routing issue.What should I do?Below is the screenshot:

Try
public class MyRoutingConvention : IControllerModelConvention
{
public void Apply(ControllerModel controller)
{
if (controller.ControllerType == typeof(IdentityUserController))
{
controller.Selectors.Clear();
foreach (var action in controller.Actions)
{
action.Selectors.Clear();
}
}
}
}
public class MyIdentityUserController : IdentityUserController
{
public MyIdentityUserController(IIdentityUserAppService userAppService)
: base(userAppService)
{
}
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
//...
context.Services.Configure<MvcOptions>(options =>
{
options.Conventions.Add(new MyRoutingConvention());
});
//...
}