To work with NuGet, as a package consumer or creator, you can use command-line interface (CLI) tools as well as NuGet features in Visual Studio.
You can choose one of the following ways:
Install HumanModule using the NuGet Package Manager in Visual Studio:
To install HumanModule, run the following command:
Add Human Module
Using ILoggerFactory (Optional)-
The middleware is designed to work with ILoggerFactory to provide flexibility. If you want to use your own logger using ILoggerFactory, register it in the service container before using the middleware:
Using HttpClientFactory (Optional)-
The middleware is designed to work with IHttpClientFactory to manage HTTP client lifetimes.
If you want HttpClient to be managed using IHttpClientFactory for better resilience and performance, register it in Program.cs as follows:
Use HumanModule as a Middleware in your application:
Add configuration section (configuration level)
Add site specific configuration (configuration level)
On your app configuration JSON file (Default file name appsettings.json), add the following section:
Configuration options are set in EnforcerConfig
To upgrade to the latest Enforcer version:
HumanModule in the updates section, and update.