Class ServiceSwitcherSingleton<T>
Similar to the ServiceSwitcher<T> but special.
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public class ServiceSwitcherSingleton<T> : ServiceBase, IHasLog where T : ISwitchableService
Type Parameters
T
- Inheritance
-
objectServiceSwitcherSingleton<T>
- Implements
- Inherited Members
Remarks
It will behave as singleton, but will resolve Transient! this is important. Reason is that this way we don't keep a list of all possible services active in memory, just the one that's been selected.
Constructors
ServiceSwitcherSingleton(ILogStore, LazySvc<ServiceSwitcher<T>>, object[]?)
Similar to the ServiceSwitcher<T> but special.
public ServiceSwitcherSingleton(ILogStore logStore, LazySvc<ServiceSwitcher<T>> serviceSwitcher, object[]? connect = null)
Parameters
logStore
ILogStoreserviceSwitcher
LazySvc<ServiceSwitcher<T>>connect
object[]
Remarks
It will behave as singleton, but will resolve Transient! this is important. Reason is that this way we don't keep a list of all possible services active in memory, just the one that's been selected.
Properties
IsValueCreated
public bool IsValueCreated { get; }
Property Value
Value
public T Value { get; }
Property Value
- T
Methods
ByNameId(string)
public T? ByNameId(string nameId)
Parameters
nameId
string
Returns
- T
Reset()
protected void Reset()