DependencyDescriptor(Type, Lifetime) 构造函数
初始化一个简单的服务描述
命名空间: TouchSocket.Core程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.1.4.7+7f7e1f78093c99347956e09330d5d7aca1d2bdf2
public DependencyDescriptor(
Type type,
Lifetime lifetime = Lifetime.Transient
)
Public Sub New (
type As Type,
Optional lifetime As Lifetime = Lifetime.Transient
)
new :
type : Type *
?lifetime : Lifetime
(* Defaults:
let _lifetime = defaultArg lifetime Lifetime.Transient
*)
-> DependencyDescriptor
参数
- type Type
- 指定服务的类型
- lifetime Lifetime (Optional)
- 生命周期,默认为瞬态