2 implementations of GetTemplatesAsync
aspire (1)
Templating\TemplateProvider.cs (1)
28
public async Task<IEnumerable<ITemplate>>
GetTemplatesAsync
(TemplateSource? source, CancellationToken cancellationToken = default)
Aspire.Cli.Tests (1)
Commands\NewCommandChannelResolutionTests.cs (1)
770
public Task<IEnumerable<ITemplate>>
GetTemplatesAsync
(TemplateSource? source, CancellationToken cancellationToken = default) =>
17 references to GetTemplatesAsync
aspire (4)
Commands\NewCommand.cs (2)
637
var availableTemplates = (await _templateProvider.
GetTemplatesAsync
(null, cancellationToken)).ToArray();
733
var templates = (await _templateProvider.
GetTemplatesAsync
(source, cancellationToken)).ToArray();
Templating\ConfiguredTemplateSourceService.cs (2)
81
() => templateProvider.
GetTemplatesAsync
(source, cancellationToken));
87
templates = await templateProvider.
GetTemplatesAsync
(source, cancellationToken);
Aspire.Cli.Tests (13)
Commands\NewCommandLocalTemplateTests.cs (12)
1333
templateProvider.
GetTemplatesAsync
(new TemplateSource("template", null, null), new CancellationToken(canceled: true)));
1350
var templates = await provider.GetRequiredService<ITemplateProvider>().
GetTemplatesAsync
(new TemplateSource("template", null, null));
1563
provider.GetRequiredService<ITemplateProvider>().
GetTemplatesAsync
(
1595
var first = Assert.Single(await templates.
GetTemplatesAsync
(new TemplateSource("template", "-repository", "main")));
1604
Assert.Single(await templates.
GetTemplatesAsync
(new TemplateSource("./template", "-repository", "v1")));
1742
Assert.Single(await templates.
GetTemplatesAsync
(source));
1745
Assert.Single(await templates.
GetTemplatesAsync
(new TemplateSource("./one", "repository-a", "same-commit-tag")));
1752
templates.
GetTemplatesAsync
(new TemplateSource("missing", "repository-a", "main")));
1786
firstProvider.GetRequiredService<ITemplateProvider>().
GetTemplatesAsync
(source),
1787
secondProvider.GetRequiredService<ITemplateProvider>().
GetTemplatesAsync
(source)).DefaultTimeout();
1826
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => templateProvider.
GetTemplatesAsync
(source, cancellation.Token));
1830
var exception = await Assert.ThrowsAsync<TemplateDiscoveryException>(() => templateProvider.
GetTemplatesAsync
(source));
Commands\NewCommandLocalTemplateTests.NuGetValues.cs (1)
430
var templates = await provider.GetRequiredService<ITemplateProvider>().
GetTemplatesAsync
(new TemplateSource("template", null, null));