Click or drag to resize

ServiceRegisterTService Method (FuncTService, Boolean)

Registers a lazy implementation for the given service

Namespace:  Couchbase.Lite.DI
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 2.0.0-b0713
Syntax
C#
public static void Register<TService>(
	Func<TService> generator,
	bool transient = false
)
where TService : class

Parameters

generator
Type: SystemFuncTService
The function that creates the object to use
transient (Optional)
Type: SystemBoolean
If true each call to GetInstanceT will return a new instance, otherwise use a singleton

Type Parameters

TService
The service type
See Also