Lamar.Microsoft.DependencyInjection connects an ASP.NET Core application to Lamar as its dependency-injection container. Setup follows three steps: install the NuGet package, call UseLamar() on WebApplicationBuilder.Host, and register application services. section 31.3
A minimal integration workflow is:
- Install Lamar.Microsoft.DependencyInjection with dotnet add package or a PackageReference. section 31.3
- Call builder.Host.UseLamar() in Program.cs. section 31.3
- Configure the supplied ServiceRegistry, which supports built-in registrations such as AddControllers() and AddAuthorization(). section 31.3
- Use AddControllersAsServices() when MVC controller dependencies are registered with Lamar, so Lamar builds the controllers. section 31.3
