UseLamar() configures Lamar as the dependency injection container for an ASP.NET Core application. Install Lamar.Microsoft.DependencyInjection, call the method on builder.Host, and register services inside its lambda. section 31.3
The configuration supports several responsibilities:
- Add ASP.NET Core services such as authorization and controllers through Lamar's ServiceRegistry. section 31.3
- Use AddControllersAsServices() when MVC controller dependencies are registered with Lamar. section 31.3
- Scan assemblies and register concrete classes that follow default service-naming conventions. section 31.3
