IComponentManager.TryGetComponent<T>(Guid, T) Method

Definition

Gets specific component via Guid. E.g: to lookup implementation of "Restore NuGet packages" post action, pass in {210D431B-A78B-4D2F-B762-4ED3E3EA9025} Guid.

C#
public bool TryGetComponent<T> (Guid id, out T? component) where T : class, Microsoft.TemplateEngine.Abstractions.IIdentifiedComponent;

Type Parameters

T

type to lookup.

Parameters

id
Guid

Guid that is defined in Id.

component
T

singleton instance of requested component.

Returns

true if component was found.

Remarks

If T and Guid mismatch, false is returned.

Applies to

Producto Versiones
Template Engine 6.0.100, 7.0.100