diff --git a/src/Microsoft.TemplateEngine.Core/Operations/BalancedNesting.cs b/src/Microsoft.TemplateEngine.Core/Operations/BalancedNesting.cs index 9a7fef1b4ef..f3aaa7d7c7f 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/BalancedNesting.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/BalancedNesting.cs @@ -22,7 +22,6 @@ public class BalancedNesting : IOperationProvider private readonly ITokenConfig _startToken; private readonly ITokenConfig _realEndToken; private readonly ITokenConfig _pseudoEndToken; - private readonly string? _id; private readonly string? _resetFlag; private readonly bool _initialState; @@ -31,12 +30,12 @@ public BalancedNesting(ITokenConfig startToken, ITokenConfig realEndToken, IToke _startToken = startToken; _realEndToken = realEndToken; _pseudoEndToken = pseudoEndToken; - _id = id; + Id = id; _resetFlag = resetFlag; _initialState = initialState; } - public string? Id => _id; + public string? Id { get; } public IOperation GetOperation(Encoding encoding, IProcessorState processorState) { @@ -44,7 +43,7 @@ public IOperation GetOperation(Encoding encoding, IProcessorState processorState IToken realEndToken = _realEndToken.ToToken(encoding); IToken pseudoEndToken = _pseudoEndToken.ToToken(encoding); - return new Implementation(startToken, realEndToken, pseudoEndToken, _id, _resetFlag, _initialState); + return new Implementation(startToken, realEndToken, pseudoEndToken, Id, _resetFlag, _initialState); } private class Implementation : IOperation diff --git a/src/Microsoft.TemplateEngine.Core/Operations/Conditional.cs b/src/Microsoft.TemplateEngine.Core/Operations/Conditional.cs index c08549898b6..11f12db7f9f 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/Conditional.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/Conditional.cs @@ -128,7 +128,6 @@ private class Implementation : IOperation private readonly Conditional _definition; private readonly Stack _pendingCompletion = new Stack(); private readonly ITokenTrie _trie; - private readonly string? _id; private EvaluationState? _current; public Implementation(Conditional definition, IReadOnlyList tokens, ITokenTrie trie, string? id, bool initialState) @@ -136,11 +135,11 @@ public Implementation(Conditional definition, IReadOnlyList tokens, ITok _trie = trie; _definition = definition; Tokens = tokens; - _id = id; + Id = id; IsInitialStateOn = string.IsNullOrEmpty(id) || initialState; } - public string? Id => _id; + public string? Id { get; } public IReadOnlyList Tokens { get; } diff --git a/src/Microsoft.TemplateEngine.Core/Operations/ExpandVariables.cs b/src/Microsoft.TemplateEngine.Core/Operations/ExpandVariables.cs index 486fec3e205..ac71b9434df 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/ExpandVariables.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/ExpandVariables.cs @@ -10,20 +10,19 @@ public class ExpandVariables : IOperationProvider { public static readonly string OperationName = "expandvariables"; - private readonly string? _id; private readonly bool _initialState; public ExpandVariables(string? id, bool initialState) { - _id = id; + Id = id; _initialState = initialState; } - public string? Id => _id; + public string? Id { get; } public IOperation GetOperation(Encoding encoding, IProcessorState processor) { - return new Implementation(processor, _id, _initialState); + return new Implementation(processor, Id, _initialState); } private class Implementation : IOperation diff --git a/src/Microsoft.TemplateEngine.Core/Operations/Include.cs b/src/Microsoft.TemplateEngine.Core/Operations/Include.cs index c83b445982f..c616a04dab8 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/Include.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/Include.cs @@ -11,8 +11,6 @@ public class Include : IOperationProvider { public static readonly string OperationName = "include"; - private readonly string? _id; - private readonly bool _initialState; public Include(ITokenConfig startToken, ITokenConfig endToken, Func sourceStreamOpener, string? id, bool initialState) @@ -20,7 +18,7 @@ public Include(ITokenConfig startToken, ITokenConfig endToken, Func SourceStreamOpener { get; } - public string? Id => _id; + public string? Id { get; } public IOperation GetOperation(Encoding encoding, IProcessorState processorState) { @@ -38,7 +36,7 @@ public IOperation GetOperation(Encoding encoding, IProcessorState processorState IToken endTokenBytes = EndToken.ToToken(encoding); TokenTrie endTokenMatcher = new TokenTrie(); endTokenMatcher.AddToken(endTokenBytes); - return new Implementation(tokenBytes, endTokenMatcher, this, _id, _initialState); + return new Implementation(tokenBytes, endTokenMatcher, this, Id, _initialState); } private class Implementation : IOperation diff --git a/src/Microsoft.TemplateEngine.Core/Operations/InlineMarkupConditional.cs b/src/Microsoft.TemplateEngine.Core/Operations/InlineMarkupConditional.cs index 27742fc33fb..a6fd33b6faf 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/InlineMarkupConditional.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/InlineMarkupConditional.cs @@ -9,13 +9,12 @@ namespace Microsoft.TemplateEngine.Core.Operations { public class InlineMarkupConditional : IOperationProvider { - private readonly string? _id; private readonly bool _initialState; public InlineMarkupConditional(MarkupTokens tokens, bool wholeLine, bool trimWhitespace, ConditionEvaluator evaluator, string variableFormat, string? id, bool initialState) { Tokens = tokens; - _id = id; + Id = id; Evaluator = evaluator; WholeLine = wholeLine; TrimWhitespace = trimWhitespace; @@ -25,7 +24,7 @@ public InlineMarkupConditional(MarkupTokens tokens, bool wholeLine, bool trimWhi public ConditionEvaluator Evaluator { get; } - public string? Id => _id; + public string? Id { get; } public MarkupTokens Tokens { get; } @@ -65,7 +64,7 @@ public IOperation GetOperation(Encoding encoding, IProcessorState processorState closeCommentToken); IReadOnlyList start = new[] { Tokens.OpenConditionExpression.ToToken(processorState.Encoding) }; - return new Implementation(this, start, structureTrie, closeConditionTrie, scanBackTrie, mapping, _id, _initialState); + return new Implementation(this, start, structureTrie, closeConditionTrie, scanBackTrie, mapping, Id, _initialState); } private class Implementation : IOperation diff --git a/src/Microsoft.TemplateEngine.Core/Operations/PhasedOperation.cs b/src/Microsoft.TemplateEngine.Core/Operations/PhasedOperation.cs index 9997dcb263e..c6815c102fd 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/PhasedOperation.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/PhasedOperation.cs @@ -9,17 +9,16 @@ namespace Microsoft.TemplateEngine.Core.Operations public class PhasedOperation : IOperationProvider { private readonly IReadOnlyList _config; - private readonly string? _id; private readonly bool _initialState; public PhasedOperation(string? id, IReadOnlyList config, bool initialState) { - _id = id; + Id = id; _config = config; _initialState = initialState; } - public string? Id => _id; + public string? Id { get; } public IOperation GetOperation(Encoding encoding, IProcessorState processorState) { @@ -98,10 +97,10 @@ public Implementation(PhasedOperation definition, IReadOnlyList config, _definition = definition; Tokens = config; _entryPoints = entryPoints; - IsInitialStateOn = string.IsNullOrEmpty(_definition._id) || initialState; + IsInitialStateOn = string.IsNullOrEmpty(_definition.Id) || initialState; } - public string? Id => _definition._id; + public string? Id => _definition.Id; public IReadOnlyList Tokens { get; } diff --git a/src/Microsoft.TemplateEngine.Core/Operations/Region.cs b/src/Microsoft.TemplateEngine.Core/Operations/Region.cs index 97a680cc88e..d9a945f4878 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/Region.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/Region.cs @@ -16,7 +16,6 @@ public class Region : IOperationProvider private readonly bool _toggle; private readonly bool _wholeLine; private readonly bool _trimWhitespace; - private readonly string? _id; private readonly bool _initialState; public Region(ITokenConfig start, ITokenConfig end, bool include, bool wholeLine, bool trimWhitespace, string? id, bool initialState) @@ -27,17 +26,17 @@ public Region(ITokenConfig start, ITokenConfig end, bool include, bool wholeLine _end = end; _include = include; _toggle = _start.Equals(_end); - _id = id; + Id = id; _initialState = initialState; } - public string? Id => _id; + public string? Id { get; } public IOperation GetOperation(Encoding encoding, IProcessorState processorState) { IToken startToken = _start.ToToken(encoding); IToken endToken = _end.ToToken(encoding); - return new Implementation(this, startToken, endToken, _include, _toggle, _id, _initialState); + return new Implementation(this, startToken, endToken, _include, _toggle, Id, _initialState); } private class Implementation : IOperation diff --git a/src/Microsoft.TemplateEngine.Core/Operations/Replacement.cs b/src/Microsoft.TemplateEngine.Core/Operations/Replacement.cs index 1a230a54d7a..9990d530cd9 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/Replacement.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/Replacement.cs @@ -12,18 +12,17 @@ public class Replacement : IOperationProvider private readonly ITokenConfig _match; private readonly string? _replaceWith; - private readonly string? _id; private readonly bool _initialState; public Replacement(ITokenConfig match, string? replaceWith, string? id, bool initialState) { _match = match; _replaceWith = replaceWith; - _id = id; + Id = id; _initialState = initialState; } - public string? Id => _id; + public string? Id { get; } public IOperation GetOperation(Encoding encoding, IProcessorState processorState) { @@ -35,7 +34,7 @@ public IOperation GetOperation(Encoding encoding, IProcessorState processorState return null!; } - return new Implementation(token, replaceWith, _id, _initialState); + return new Implementation(token, replaceWith, Id, _initialState); } private class Implementation : IOperation diff --git a/src/Microsoft.TemplateEngine.Core/Operations/SetFlag.cs b/src/Microsoft.TemplateEngine.Core/Operations/SetFlag.cs index f86d6e5cfff..301deea36c0 100644 --- a/src/Microsoft.TemplateEngine.Core/Operations/SetFlag.cs +++ b/src/Microsoft.TemplateEngine.Core/Operations/SetFlag.cs @@ -10,7 +10,6 @@ public class SetFlag : IOperationProvider { public static readonly string OperationName = "flags"; - private readonly string? _id; private readonly bool _initialState; public SetFlag(string? name, ITokenConfig on, ITokenConfig off, ITokenConfig onNoEmit, ITokenConfig offNoEmit, string? id, bool initialState, bool? @default = null) @@ -21,11 +20,11 @@ public SetFlag(string? name, ITokenConfig on, ITokenConfig off, ITokenConfig onN OnNoEmit = onNoEmit; OffNoEmit = offNoEmit; Default = @default; - _id = id; + Id = id; _initialState = initialState; } - public string? Id => _id; + public string? Id { get; } public string? Name { get; } @@ -54,7 +53,7 @@ public IOperation GetOperation(Encoding encoding, IProcessorState processorState processorState.Config.Flags[Name!] = Default.Value; } - return new Implementation(this, tokens, _id, _initialState); + return new Implementation(this, tokens, Id, _initialState); } private class Implementation : IOperation diff --git a/src/Microsoft.TemplateEngine.Edge/DefaultTemplateEngineHost.cs b/src/Microsoft.TemplateEngine.Edge/DefaultTemplateEngineHost.cs index fed10c7e1a8..a9ee1447c7a 100644 --- a/src/Microsoft.TemplateEngine.Edge/DefaultTemplateEngineHost.cs +++ b/src/Microsoft.TemplateEngine.Edge/DefaultTemplateEngineHost.cs @@ -14,8 +14,6 @@ public class DefaultTemplateEngineHost : ITemplateEngineHost private static readonly IReadOnlyList<(Type, IIdentifiedComponent)> NoComponents = Array.Empty<(Type, IIdentifiedComponent)>(); private readonly IReadOnlyDictionary _hostDefaults; private readonly IReadOnlyList<(Type InterfaceType, IIdentifiedComponent Instance)> _hostBuiltInComponents; - private readonly ILoggerFactory _loggerFactory; - private readonly ILogger _logger; public DefaultTemplateEngineHost( string hostIdentifier, @@ -33,8 +31,8 @@ public DefaultTemplateEngineHost( FallbackHostTemplateConfigNames = fallbackHostTemplateConfigNames ?? new List(); loggerFactory ??= NullLoggerFactory.Instance; - _loggerFactory = loggerFactory; - _logger = _loggerFactory.CreateLogger("Template Engine") ?? NullLogger.Instance; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger("Template Engine") ?? NullLogger.Instance; WorkingDirectory = Environment.CurrentDirectory; } @@ -51,9 +49,9 @@ public DefaultTemplateEngineHost( public virtual IReadOnlyList<(Type InterfaceType, IIdentifiedComponent Instance)> BuiltInComponents => _hostBuiltInComponents; - public ILogger Logger => _logger; + public ILogger Logger { get; } - public ILoggerFactory LoggerFactory => _loggerFactory; + public ILoggerFactory LoggerFactory { get; } // stub that will be built out soon. public virtual bool TryGetHostParamDefault(string paramName, out string? value) @@ -78,7 +76,7 @@ public void VirtualizeDirectory(string path) public void Dispose() { - _loggerFactory?.Dispose(); + LoggerFactory?.Dispose(); } #region Obsoleted diff --git a/src/Microsoft.TemplateEngine.Edge/Template/ParameterSetBuilder.cs b/src/Microsoft.TemplateEngine.Edge/Template/ParameterSetBuilder.cs index fae6ed043be..3d9d2f2c50d 100644 --- a/src/Microsoft.TemplateEngine.Edge/Template/ParameterSetBuilder.cs +++ b/src/Microsoft.TemplateEngine.Edge/Template/ParameterSetBuilder.cs @@ -346,9 +346,6 @@ private void EvaluateConditionalParameters(IGenerator generator, ILogger logger) private class EvalData { - private object? _value; - private DataSource _dataSource = DataSource.NoSource; - public EvalData(ITemplateParameter parameterDefinition) { ParameterDefinition = parameterDefinition; @@ -357,7 +354,7 @@ public EvalData(ITemplateParameter parameterDefinition) public EvalData(EvaluatedInputParameterData other) : this(other.ParameterDefinition, other.Value, other.IsEnabledConditionResult, other.IsRequiredConditionResult) { - this._dataSource = DataSource.NoSource; + this.DataSource = DataSource.NoSource; } private EvalData( @@ -367,7 +364,7 @@ private EvalData( bool? isRequiredConditionResult) { ParameterDefinition = parameterDefinition; - _value = value; + Value = value; IsEnabledConditionResult = isEnabledConditionResult; IsRequiredConditionResult = isRequiredConditionResult; } @@ -380,14 +377,14 @@ private EvalData( public bool? IsRequiredConditionResult { get; set; } - public DataSource DataSource => _dataSource; + public DataSource DataSource { get; private set; } = DataSource.NoSource; - public object? Value => _value; + public object? Value { get; private set; } public void SetValue(object? value, DataSource source) { - _value = value; - _dataSource = source; + Value = value; + DataSource = source; InputDataState = InputDataStateUtil.GetInputDataState(value); } @@ -398,7 +395,7 @@ public EvaluatedInputParameterData ToParameterData() return new EvaluatedInputParameterData( this.ParameterDefinition, this.Value, - _dataSource, + DataSource, this.IsEnabledConditionResult, this.IsRequiredConditionResult, InputDataState); @@ -406,10 +403,10 @@ public EvaluatedInputParameterData ToParameterData() public EvalData Clone() { - var ds = _dataSource; + var ds = DataSource; return new EvalData(ParameterDefinition, Value, IsEnabledConditionResult, IsRequiredConditionResult) { - _dataSource = ds + DataSource = ds }; } diff --git a/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.ITemplate.cs b/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.ITemplate.cs index 19616f86df5..3ee93765a36 100644 --- a/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.ITemplate.cs +++ b/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.ITemplate.cs @@ -19,11 +19,11 @@ internal partial class RunnableProjectConfig : ITemplate string ITemplateLocator.ConfigPlace => ConfigFile?.FullPath ?? throw new InvalidOperationException("Configuration file is not initialized, are you using test constructor?"); - IFileSystemInfo? ITemplate.LocaleConfiguration => _localizationInfo?.File; + IFileSystemInfo? ITemplate.LocaleConfiguration => Localization?.File; IFileSystemInfo? ITemplate.HostSpecificConfiguration => _hostConfigFile; - string? IExtendedTemplateLocator.LocaleConfigPlace => _localizationInfo?.File.FullPath; + string? IExtendedTemplateLocator.LocaleConfigPlace => Localization?.File.FullPath; string? IExtendedTemplateLocator.HostConfigPlace => _hostConfigFile?.FullPath; diff --git a/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.cs b/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.cs index 85c6a0e5baf..c8ef20e9f69 100644 --- a/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.cs +++ b/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectConfig.cs @@ -41,7 +41,6 @@ internal partial class RunnableProjectConfig : DirectoryBasedTemplate, IRunnable private static readonly string[] DefaultPlaceholderFilenames = new[] { "-.-", "_._" }; private readonly Dictionary _guidToGuidPrefixMap = new(); - private readonly TemplateLocalizationInfo? _localizationInfo; private readonly IFile? _hostConfigFile; private IReadOnlyList? _sources; @@ -66,7 +65,7 @@ internal RunnableProjectConfig(IEngineEnvironmentSettings settings, IGenerator g try { LocalizationModel locModel = LocalizationModelDeserializer.Deserialize(localeConfigFile); - _localizationInfo = new TemplateLocalizationInfo(ParseLocFileName(localeConfigFile) ?? CultureInfo.InvariantCulture, locModel, localeConfigFile); + Localization = new TemplateLocalizationInfo(ParseLocFileName(localeConfigFile) ?? CultureInfo.InvariantCulture, locModel, localeConfigFile); } catch (Exception ex) { @@ -162,7 +161,7 @@ public GlobalRunConfig GlobalOperationConfig /// internal IMountPoint SourceMountPoint { get; } - internal TemplateLocalizationInfo? Localization => _localizationInfo; + internal TemplateLocalizationInfo? Localization { get; } internal IReadOnlyList SymbolFilenameReplacements { @@ -174,11 +173,11 @@ internal IReadOnlyList SymbolFilenameReplacements } internal override IReadOnlyDictionary Localizations => - _localizationInfo is null + Localization is null ? new Dictionary() : new Dictionary() { - { _localizationInfo.Locale, _localizationInfo } + { Localization.Locale, Localization } }; internal override IReadOnlyDictionary HostFiles => diff --git a/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectGenerator.cs b/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectGenerator.cs index 2e4d527c0b2..645d1c7c29b 100644 --- a/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectGenerator.cs +++ b/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunnableProjectGenerator.cs @@ -414,15 +414,14 @@ private static ICreationResult GetCreationResult(IRunnableProjectConfig runnable private class LegacyTemplate : ITemplate { private readonly ScannedTemplateInfo _templateInfo; - private readonly IGenerator _generator; internal LegacyTemplate(ScannedTemplateInfo templateInfo, IGenerator generator) { _templateInfo = templateInfo; - _generator = generator; + Generator = generator; } - public IGenerator Generator => _generator; + public IGenerator Generator { get; } public IFileSystemInfo Configuration => _templateInfo.ConfigFile; @@ -446,7 +445,7 @@ internal LegacyTemplate(ScannedTemplateInfo templateInfo, IGenerator generator) public string Identity => _templateInfo.ConfigurationModel.Identity; - public Guid GeneratorId => _generator.Id; + public Guid GeneratorId => Generator.Id; public string? GroupIdentity => _templateInfo.ConfigurationModel.GroupIdentity; diff --git a/src/Microsoft.TemplateEngine.Utils/DefaultTemplateEngineHost.cs b/src/Microsoft.TemplateEngine.Utils/DefaultTemplateEngineHost.cs index 7df745dad51..45ca9f8a2a3 100644 --- a/src/Microsoft.TemplateEngine.Utils/DefaultTemplateEngineHost.cs +++ b/src/Microsoft.TemplateEngine.Utils/DefaultTemplateEngineHost.cs @@ -15,8 +15,6 @@ public class DefaultTemplateEngineHost : ITemplateEngineHost private readonly IReadOnlyDictionary _hostDefaults; private readonly IReadOnlyList<(Type InterfaceType, IIdentifiedComponent Instance)> _hostBuiltInComponents; private readonly Dictionary> _diagnosticLoggers; - private readonly ILoggerFactory _loggerFactory; - private readonly ILogger _logger; public DefaultTemplateEngineHost(string hostIdentifier, string version) : this(hostIdentifier, version, null) @@ -47,8 +45,8 @@ public DefaultTemplateEngineHost(string hostIdentifier, string version, Dictiona _hostBuiltInComponents = builtIns ?? NoComponents; FallbackHostTemplateConfigNames = fallbackHostTemplateConfigNames ?? new List(); _diagnosticLoggers = new Dictionary>(); - _loggerFactory = NullLoggerFactory.Instance; - _logger = _loggerFactory.CreateLogger("Template Engine") ?? NullLogger.Instance; + LoggerFactory = NullLoggerFactory.Instance; + Logger = LoggerFactory.CreateLogger("Template Engine") ?? NullLogger.Instance; } public IPhysicalFileSystem FileSystem { get; private set; } @@ -63,9 +61,9 @@ public DefaultTemplateEngineHost(string hostIdentifier, string version, Dictiona public virtual IReadOnlyList<(Type InterfaceType, IIdentifiedComponent Instance)> BuiltInComponents => _hostBuiltInComponents; - public ILogger Logger => _logger; + public ILogger Logger { get; } - public ILoggerFactory LoggerFactory => _loggerFactory; + public ILoggerFactory LoggerFactory { get; } public virtual void LogMessage(string message) { @@ -142,7 +140,7 @@ public void LogTiming(string label, TimeSpan duration, int depth) public void Dispose() { - _loggerFactory?.Dispose(); + LoggerFactory?.Dispose(); } } } diff --git a/test/Microsoft.TemplateSearch.Common.UnitTests/MockTemplateSearchSource.cs b/test/Microsoft.TemplateSearch.Common.UnitTests/MockTemplateSearchSource.cs index 1a9911c0118..d350be6fa9f 100644 --- a/test/Microsoft.TemplateSearch.Common.UnitTests/MockTemplateSearchSource.cs +++ b/test/Microsoft.TemplateSearch.Common.UnitTests/MockTemplateSearchSource.cs @@ -30,10 +30,9 @@ public ITemplateSearchProvider CreateProvider(IEngineEnvironmentSettings environ public class MockTemplateSearchProvider : ITemplateSearchProvider { - private bool _wasSearched; private ITemplateSearchProviderFactory? _factory; - public bool WasSearched => _wasSearched; + public bool WasSearched { get; private set; } public IReadOnlyList<(ITemplatePackageInfo PackageInfo, IReadOnlyList MatchedTemplates)> Results { get; set; } = Array.Empty<(ITemplatePackageInfo, IReadOnlyList)>(); @@ -49,7 +48,7 @@ public ITemplateSearchProviderFactory Factory Func> matchingTemplatesFilter, CancellationToken cancellationToken) { - _wasSearched = true; + WasSearched = true; return Task.FromResult(Results); } }