Click or drag to resize

ISharingLifetimeScopeGetOrCreateAndShare Method

Try to retrieve an instance based on a GUID key. If the instance does not exist, invoke creator to create it.

Namespace:  Autofac.Core
Assembly:  Autofac (in Autofac.dll) Version: 4.9.1+831973f4d02fbc619921dfaa8ac0c536f60ae7a3
Syntax
Object GetOrCreateAndShare(
	Guid id,
	Func<Object> creator
)

Parameters

id
Type: SystemGuid
Key to look up.
creator
Type: SystemFuncObject
Creation function.

Return Value

Type: Object
An instance.
See Also