Welcome to Autofac’s documentation!
[欢迎查看Autofac的文档!]
Autofac is an addictive IoC container for .NET. It manages the dependencies between classes so that applications stay easy to change as they grow in size and complexity. This is achieved by treating regular .NET classes as components.
Autofac 是一个令人痴迷的关于.NET的IoC容器。它管理类之间的依赖关系,以便使应用程序在大小和复杂性的增长中保持容易维护.。它的目标是将.NET类做为组件方便有效的管理。
- Getting Started
- What’s New
- Registering Components
- Resolving Services
- Controlling Scope and Lifetime
- Configuration
- Application Integration
- Best Practices and Recommendations
- Always Resolve Dependencies from Nested Lifetimes
- Structure Configuration with Modules
- Use As() in Delegate Registrations
- Use Constructor Injection
- Use Relationship Types, Not Service Locators
- Register Components from Least-to-Most Specific
- Use Profilers for Performance Checking
- Register Once, Resolve Many
- Register Frequently-Used Components with Lambdas
- Consider a Container as Immutable
- Optimize or Avoid Diagnostics
- Advanced Topics
- Registration Sources
- Adapters and Decorators
- Composites
- Circular Dependencies
- Component Metadata / Attribute Metadata
- Named and Keyed Services
- Delegate Factories
- Owned Instances
- Pooled Instances
- Handling Concurrency
- Multitenant Applications
- Resolve Pipelines
- Service Pipelines vs Registration Pipelines
- Pipeline Phases
- Adding Registration Middleware
- ResolveRequestContext
- Adding Service Middleware
- Service Middleware Sources
- Aggregate Services
- Type Interceptors
- Cross-Platform and Native Applications
- Debugging and Troubleshooting
- Examples
- Frequently Asked Questions
- How do I work with per-request lifetime scope?
- How do I pick a service implementation by context?
- How do I create a session-based lifetime scope in a web application?
- Why aren’t my assemblies getting scanned after IIS restart?
- How do I conditionally register components?
- How do I share component registrations across application types?
- How do I keep Autofac references isolated away from my app?
- Why are “old versions” of the framework (e.g., System.Core 2.0.5.0) referenced?
- Why don’t all Autofac packages target the latest Autofac core?
- How do I inject configuration, environment, or context parameters?
- How do I pass a parameter to a component in the middle of a resolve chain?
- Why isn’t container registration analysis built in?
- Why are things in my Xamarin app misbehaving?
- Glossary
- Contributor Guide
- Getting Support
- API Documentation
- Owner’s Guide