IUnreferenceable

Interface for components that require the capacity to clear previously defined references to dependent components.

Description

The IUnreferenceable interface can be used for components that require the capacity to clear previously defined references to dependent components.

Instance methods

unsetReferences

Unsets (clears) previously set references to dependent components.

unsetReferences(): void

Examples

type MyController  {
			_persistence IMyPersistence;
		}
		func (mc* MyController) SetReferences(ctx context.Context, references *IReferences) {
			mc._persistence = references.GetOneRequired(
				NewDescriptor("mygroup", "persistence", "*", "*", "1.0"),
			);
		}

		func (mc* MyController) UnsetReferences(ctx context.Context) {
			mc._persistence = nil;
		}

See also