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