dependency-injection-autofac

Community

Wiring Autofac modules for scalable DI.

Authorbbolek-ap
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Autofac-based module wiring organizes dependency injection across service layers (Domain, Application, Infrastructure) to support clean architecture with centralized registrations and correct lifetimes.

Core Features & Use Cases

  • Module-per-layer pattern: one Autofac Module per layer (Domain, Application, Infrastructure) to organize registrations.
  • MediatR and Validators: register MediatR handlers and FluentValidation validators via assembly scanning.
  • DbContext and repositories: register EF Core DbContext and repository implementations with proper lifetimes.
  • Program.cs host integration: wire Autofac into the Api host as the DI container.
  • Lifetime guidance: recommended lifetimes for DbContext, repositories, MediatR handlers, and HTTP clients.

Quick Start

Create a Module that registers DomainModule, ApplicationModule, and InfrastructureModule and wire it into the Api host.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: dependency-injection-autofac
Download link: https://github.com/bbolek-ap/new-ai-native/archive/main.zip#dependency-injection-autofac

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.