您的位置:首页 > 移动开发

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: