Ioc:The basic pattern for integrating Autofac into your application
2014-05-16 21:34
417 查看
The basic pattern for integrating Autofac into your application is:
Structure your app with inversion of control (IoC) in mind.
Add Autofac references.
At application startup...
Create a ContainerBuilder.
Register components.
Build the container and store it for later use.
During application execution...
Create a lifetime scope from the container.
Use the lifetime scope to resolve instances of the components.
Structure your app with inversion of control (IoC) in mind.
Add Autofac references.
At application startup...
Create a ContainerBuilder.
Register components.
Build the container and store it for later use.
During application execution...
Create a lifetime scope from the container.
Use the lifetime scope to resolve instances of the components.
相关文章推荐
- Compiling Your Application with the Microsoft Layer for Unicode
- Some basic skills (2) - Configure the printer for your SAP systems
- Using Clang as a Library----Choosing the Right Interface for Your Application---翻译
- Application Blocks for the .NET Compact Framework
- 基于XML应用程序部署清单文件结构(Creating a Manifest for Your Application)
- WPF Rocks! Check out the first Certified for Vista WPF Application - iBlocks
- 关于控制反转IoC--Inversion of Control Containers and the Dependency Injection pattern
- The Best of Both Worlds: Integrating JSF with Struts in Your J2EE Applications
- [[Advanced T-SQL]] Automate the Generation of Stored Procedures for Your Database
- How to Hook the Mouse to Catch Events Outside of your application
- The Best of Both Worlds: Integrating JSF with Struts in Your J2EE Applications
- Managing Your ASP.NET Application[3]->Using the Management API
- How to Integrate Google Searches into Your Application
- Adding XP Visual Styles to Your Visual Basic Application
- [转]Composite UI Application Block - December 2005 Release for C# and Visual Basic .NET Now on MSDN!
- WPF Rocks! Check out the first Certified for Vista WPF Application - iBlocks
- office 办公软件中利用VBA(Visual Basic for Application)宏
- Svcutil.exe – Generate the proxy class for the WCF client application
- Adding XP Visual Styles to Your Visual Basic Application
- Automate the Generation of Stored Procedures for Your Database