本文主要是介绍Welcome to Autofac’s documentation!,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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
- Structuring the Application
- Add Autofac References
- Application Startup
- Application Execution
- Going Further
- Need Help?
- Building from Source
- What’s New
- Release Notes
- Upgrading from Autofac 5.x to 6.x
- Upgrading from Autofac 3.x to 4.x
- Registering Components
- Registration Concepts
- Reflection Components
- Instance Components
- Lambda Expression Components
- Open Generic Components
- Services vs. Components
- Default Registrations
- Conditional Registration
- Configuration of Registrations
- Dynamically-Provided Registrations
- Passing Parameters to Register
- Available Parameter Types
- Parameters with Reflection Components
- Parameters with Lambda Expression Components
- Property and Method Injection
- Property Injection
- Method Injection
- Assembly Scanning
- Scanning for Types
- Scanning for Modules
- IIS Hosted Web Applications
- Registration Concepts
- Resolving Services
- Passing Parameters to Resolve
- Available Parameter Types
- Parameters with Reflection Components
- Parameters with Lambda Expression Components
- Passing Parameters Without Explicitly Calling Resolve
- Implicit Relationship Types
- Supported Relationship Types
- Composing Relationship Types
- Relationship Types and Container Independence
- Passing Parameters to Resolve
- Controlling Scope and Lifetime
- Basic Concepts and Terminology
- Scopes and Hierarchy
- Example: Singleton Lifetime
- Example: Web Application
- Additional Topics to Explore
- Working with Lifetime Scopes
- Instance Scope
- Captive Dependencies
- Disposal
- Lifetime Events
- Running Code at Container Build
- Configuration
- JSON/XML Configuration
- Configuring With Microsoft Configuration (4.0+)
- Configuring With Application Configuration (Legacy Pre-4.0)
- Modules
- Introduction
- Advantages of Modules
- Example
- Adapting to the Deployment Environment
- Common Use Cases for Modules
- JSON/XML Configuration
- Application Integration
- ASP.NET
- OWIN
- MVC
- Web API
- SignalR
- Web Forms
- .NET Core
- Quick Start
- Using a Child Scope as a Root
- ASP.NET Core
- Quick Start
- Configuration Method Naming Conventions
- Dependency Injection Hooks
- Differences From ASP.NET Classic
- Controllers as Services
- Multitenant Support
- Using a Child Scope as a Root
- Example
- Blazor
- Windows Communication Foundation (WCF)
- Clients
- Services
- Service Fabric
- Quick Start
- Per-Request Scopes
- Example
- Managed Extensibility Framework (MEF)
- Consuming MEF Extensions in Autofac
- Providing Autofac Components to MEF Extensions
- Using Metadata
- Known Issues / Gotchas
- Common Service Locator
- Moq
- Getting Started
- Configuring Mocks
- Configuring Specific Dependencies
- FakeItEasy
- Getting Started
- Configuring Fakes
- Configuring Specific Dependencies
- Options for Fakes
- ASP.NET
- 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
- “Any Concrete Type Not Already Registered” Source
- Implementing a Registration Source
- Adapters and Decorators
- Adapters
- Decorators
- Composites
- Metadata
- Lifetime
- Decorators
- Composites and Collections
- Circular Dependencies
- Property/Property Dependencies
- Constructor/Property Dependencies
- Constructor/Constructor Dependencies
- Component Metadata / Attribute Metadata
- Adding Metadata to a Component Registration
- Consuming Metadata
- Strongly-Typed Metadata
- Interface-Based Metadata
- Attribute-Based Metadata
- Named and Keyed Services
- Named Services
- Keyed Services
- Delegate Factories
- Create a Delegate
- Consume the Delegate
- Add Resolved Constructor Parameters
- Lifetime Scopes and Disposal
- Owned Instances
- Lifetime and Scope
- Relationship Types
- Pooled Instances
- Getting Started
- Resetting Pooled Instances Between Resolves
- Pool Capacity
- Matching Lifetime Scopes
- Pool Policies
- Handling Concurrency
- Component Registration
- Service Resolution
- Lifetime Events
- Thread Scoped Services
- Internals
- Thread-Safe Types
- Deadlock Avoidance
- Multitenant Applications
- What Is Multitenancy?
- General Principles
- ASP.NET Integration
- ASP.NET Core Integration
- WCF Integration
- Tenant ID Strategy Tips
- Example
- Resolve Pipelines
- Service Pipelines vs Registration Pipelines
- Pipeline Phases
- Adding Registration Middleware
- Defining Middleware Classes
- Adding Middleware to all Registrations
- ResolveRequestContext
- Adding Service Middleware
- Service Middleware Sources
- Aggregate Services
- Introduction
- Required References
- Getting Started
- How Aggregate Services are Resolved
- Properties
- Methods
- Property Setters and Void Methods
- How It Works
- Performance Considerations
- Type Interceptors
- Enabling Interception
- Tips
- Known Issues
- Cross-Platform and Native Applications
- Xamarin
- .NET Native
- Debugging and Troubleshooting
- Exceptions
- Diagnostics
- Symbols and Sources
- Support
- Registration Sources
- Examples
- Examples Repository
- log4net Integration Middleware
- Frequently Asked Questions
- How do I work with per-request lifetime scope?
- Note on ASP.NET Core
- Registering Dependencies as Per-Request
- How Per-Request Lifetime Works
- Sharing Dependencies Across Apps Without Requests
- Testing with Per-Request Dependencies
- Troubleshooting Per-Request Dependencies
- Implementing Custom Per-Request Semantics
- How do I pick a service implementation by context?
- Option 1: Redesign Your Interfaces
- Option 2: Change the Registrations
- Option 3: Use Keyed Services
- Option 4: Use Metadata
- How do I create a session-based lifetime scope in a web application?
- Why This is a Bad Idea
- How to Do It
- Why aren’t my assemblies getting scanned after IIS restart?
- How do I conditionally register components?
- Use Configuration
- Use Modules
- Lambda Registrations
- How do I share component registrations across application types?
- How do I keep Autofac references isolated away from my app?
- Application Startup
- Component Registrations
- Service Resolution
- 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?
- Option 1: Register Using a Lambda
- Option 2: Use a Provider
- How do I pass a parameter to a component in the middle of a resolve chain?
- Why This is a Design Problem
- Solutions
- Why isn’t container registration analysis built in?
- Why are things in my Xamarin app misbehaving?
- How do I work with per-request lifetime scope?
- Glossary
- Contributor Guide
- Getting Support
- Community Support
- Commercial Support
- Filing an Issue
- API Documentation
- Owner’s Guide
- Ownership is About Trust
- Code of Conduct
- Responsibilities
- API Design
- Bug Fixes and Enhancements
- Performance and Testing
- Issue Review
- Pull Request Review
- Support
- Documentation and Examples
- Compatibility
- Release Process
- You Are Not Alone
Indices and tables
- Index
- Module Index
- Search Page
这篇关于Welcome to Autofac’s documentation!的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!