1 write to Templates
Microsoft.TemplateEngine.Cli (1)
TemplateGroup.cs (1)
48Templates = templates.ToList();
90 references to Templates
Microsoft.TemplateEngine.Cli (26)
Commands\create\InstantiateCommand.cs (2)
90foreach (IGrouping<int, CliTemplateInfo> templateGrouping in templateGroup.Templates.GroupBy(g => g.Precedence).OrderByDescending(g => g.Key)) 149.DefineColumn(t => t.GroupIdentity ?? t.Templates[0].Identity, out object? identityColumn, LocalizableStrings.ColumnNameIdentity, showAlways: true)
Commands\create\InstantiateCommand.Help.cs (1)
345foreach (IGrouping<int, CliTemplateInfo> templateGrouping in templateGroup.Templates.GroupBy(g => g.Precedence).OrderByDescending(g => g.Key))
Commands\create\InstantiateCommand.NoMatchHandling.cs (1)
64foreach (CliTemplateInfo template in templateGroup.Templates)
Commands\create\InstantiateCommand.TabCompletion.cs (3)
141if (templateGroup.Templates.SelectMany(t => t.Constraints).Any()) 166return templateGroup.Templates; 178if (group.Templates.All(t => t.Constraints.Any()))
Commands\Extensions.cs (1)
55await constraintManager.EvaluateConstraintsAsync(templateGroup.Templates, cancellationToken).ConfigureAwait(false);
TabularOutput\TemplateGroupDisplay.cs (5)
208ITemplateInfo highestPrecedenceTemplate = templateGroup.Templates.OrderByDescending(x => x.Precedence).First(); 213Languages = GetLanguagesToDisplay(templateGroup.Templates, language, defaultLanguage, environment), 214Classifications = GetClassificationsToDisplay(templateGroup.Templates, environment), 215Author = GetAuthorsToDisplay(templateGroup.Templates, environment), 216Type = GetTypesToDisplay(templateGroup.Templates, environment),
TemplateGroup.cs (11)
65foreach (ITemplateInfo template in Templates.OrderByDescending(t => t.Precedence)) 81foreach (ITemplateInfo template in Templates) 97foreach (ITemplateInfo template in Templates) 113foreach (ITemplateInfo template in Templates) 159foreach (ITemplateInfo template in Templates) 178internal bool HasSingleTemplate => Templates.Count == 1; 217var templatePackages = await Task.WhenAll(Templates.Select(t => templatePackageManager.GetTemplatePackageAsync(t, cancellationToken))).ConfigureAwait(false); 223if (!Templates.Any()) 225throw new Exception($"{nameof(Templates)} cannot be empty collection"); 228int highestPrecedence = Templates.Max(t => t.Precedence); 229return Templates.Where(t => t.Precedence == highestPrecedence);
TemplateResolution\ListTemplateResolver.cs (1)
47templateFilters = templateFilters.Concat(WellKnownSearchFilters.ConstraintFilters(await _constraintManager.GetConstraintsAsync(templateGroups.SelectMany(tg => tg.Templates).Cast<ITemplateInfo>(), cancellationToken).ConfigureAwait(false)));
TemplateResolution\TemplateGroupMatchInfo.cs (1)
218IReadOnlyCollection<ITemplateMatchInfo> templateMatchDispositions = TemplateListFilter.GetTemplateMatchInfo(group.Templates, x => true, templateInfoFilters.ToArray());
Microsoft.TemplateEngine.Cli.UnitTests (64)
ParserTests\HelpTests.cs (18)
106TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 129TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 152TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 175TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 199TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 225TemplateCommand templateCommand1 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]); 226TemplateCommand templateCommand2 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]); 250TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 278TemplateCommand templateCommand1 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]); 279TemplateCommand templateCommand2 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]); 303TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 327TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 354InstantiateCommand.ShowHintForOtherTemplates(templateGroup, templateGroup.Templates[0], args, sw); 373TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 397TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 439TemplateCommand templateCommand1 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]); 440TemplateCommand templateCommand2 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]); 464TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
ParserTests\InstantiateTests.cs (9)
257TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 323TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 366TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 410TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 481TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 526TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 550TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 583TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 747template: templateGroup.Templates.Single());
ParserTests\InstantiateTests.Subcommand.cs (5)
85TemplateCommand templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 148TemplateCommand templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 183TemplateCommand templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 226TemplateCommand templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 260TemplateCommand templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
ParserTests\TemplateCommandTests.cs (2)
52_ = new TemplateCommand(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); 57Assert.Equal(templateGroup.Templates.Single(), e.Template);
TemplateResolutionTests\ListTemplateResolverTests.cs (30)
35Assert.Equal("console2", matchResult.UnambiguousTemplateGroup?.Templates.Single().ShortNameList.Single()); 36Assert.Equal("Console.App2", matchResult.UnambiguousTemplateGroup?.Templates.Single().Identity); 37Assert.Single(matchResult.UnambiguousTemplateGroup?.Templates!); 58Assert.NotNull(matchResult.TemplateGroupsWithMatchingTemplateInfo.SelectMany(group => group.Templates).Single(t => t.Identity == "Console.App")); 59Assert.NotNull(matchResult.TemplateGroupsWithMatchingTemplateInfo.SelectMany(group => group.Templates).Single(t => t.Identity == "Console.App2")); 80Assert.Equal(3, matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates.Count); 82Assert.Equal(3, matchResult.UnambiguousTemplateGroup?.Templates.Count); 105Assert.Equal(5, matchResult.TemplateGroupsWithMatchingTemplateInfo.SelectMany(group => group.Templates).Count()); 127Assert.Equal(2, matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates.Count); 128Assert.NotNull(matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates.Single(t => t.Identity == "Console.App.L1")); 129Assert.NotNull(matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates.Single(t => t.Identity == "Console.App.L2")); 149Assert.Equal(2, matchResult.TemplateGroupsWithMatchingTemplateInfo?.Single().Templates.Count); 150Assert.Equal(2, matchResult.UnambiguousTemplateGroup?.Templates.Count); 173Assert.Single(matchResult.TemplateGroups.Single().Templates); 200Assert.Single(matchResult.TemplateGroups.Single().Templates); 227Assert.Single(matchResult.TemplateGroups.Single().Templates); 254Assert.Single(matchResult.TemplateGroups.Single().Templates); 309Assert.Single(matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates); 341Assert.Single(matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates); 345Assert.Equal("console1", matchResult.UnambiguousTemplateGroup?.Templates.Single().ShortNameList.Single()); 346Assert.Equal("Console.App.T1", matchResult.UnambiguousTemplateGroup?.Templates.Single().Identity); 374Assert.Single(matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates); 378Assert.Equal("console", matchResult.UnambiguousTemplateGroup?.Templates.Single().ShortNameList.Single()); 379Assert.Equal("Console.App.T1", matchResult.UnambiguousTemplateGroup?.Templates.Single().Identity); 404Assert.Single(matchResult.TemplateGroups.Single().Templates); 438Assert.Single(matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates); 447Assert.Single(matchResult.TemplateGroups.Single().Templates); 490Assert.Single(matchResult.TemplateGroupsWithMatchingTemplateInfo.Single().Templates); 499Assert.Single(matchResult.TemplateGroups.Single().Templates); 528Assert.Single(matchResult.TemplateGroups.Single().Templates);