耍酷歌曲

文章
5
资源
0
加入时间
4年1月24天

第三节 Autofac的生命周期

Autofac生命周期InstancePerDependencySingleInstanceInstancePerLifetimeScopeInstancePerMatchingLifetimeScopeA)InstancePerDependency在其他容器中也称为“瞬态”或“工厂”。使用per-dependency关系范围,将从服务的每个请求返回唯一的实例。如果没有指定其他选项,这是默认值。using Autofac;using Autofac.Core;using System;