How to register the custom validator in ASP.NET Core?

How to register the custom validator in ASP.NET Core.

we can register our custome validator in ASP.net core using ConfigureServices. here below I am giving the example to expalin that, How to register the custom validator in ASP.net Core application.

 

// sample
public void ConfigureServices(IServiceCollection services)
{
var builder = services.AddIdentityServer()
.AddCustomTokenRequestValidator<MyCustomRequestValidator>();
}

Leave a Reply

Your email address will not be published. Required fields are marked *