From 7f4c41fc2c6ce55f8f1b87a5516573d99a9beec0 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 19 Apr 2021 16:12:28 -0700 Subject: Prefer IReadOnlyCollection<> or IReadOnlyList<> over IEnumerable<> Closes wixtoolset/issues#6422 --- src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | 4 ++-- .../ExtensibilityServices/BurnBackendHelper.cs | 2 +- .../ExtensionCacheManagerExtensionCommandLine.cs | 2 +- .../ExtensibilityServices/WindowsInstallerBackendHelper.cs | 2 +- src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs | 2 +- src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs | 2 +- src/WixToolset.Core/Bind/ResolveFieldsCommand.cs | 2 +- src/WixToolset.Core/BindContext.cs | 14 +++++++------- src/WixToolset.Core/BindResult.cs | 4 ++-- src/WixToolset.Core/Binder.cs | 2 +- src/WixToolset.Core/CommandLine/BuildCommand.cs | 10 +++++----- src/WixToolset.Core/CommandLine/CompileCommand.cs | 2 +- src/WixToolset.Core/CompileContext.cs | 2 +- src/WixToolset.Core/CompilerCore.cs | 2 +- src/WixToolset.Core/DecompileContext.cs | 2 +- src/WixToolset.Core/DecompileResult.cs | 2 +- src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs | 2 +- .../ExtensibilityServices/ExtensionManager.cs | 2 +- src/WixToolset.Core/LayoutContext.cs | 8 ++++---- src/WixToolset.Core/LibraryContext.cs | 8 ++++---- src/WixToolset.Core/LinkContext.cs | 7 +++---- src/WixToolset.Core/PreprocessContext.cs | 4 ++-- src/WixToolset.Core/PreprocessResult.cs | 2 +- src/WixToolset.Core/ResolveContext.cs | 10 +++++----- src/WixToolset.Core/ResolveFileResult.cs | 2 +- src/WixToolset.Core/ResolveResult.cs | 4 ++-- src/WixToolset.Core/Resolver.cs | 2 +- .../ExamplePreprocessorExtensionAndCommandLine.cs | 2 +- .../ExampleWindowsInstallerBackendExtension.cs | 2 +- src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs | 5 +++-- 30 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index 37fc17f9..d8062008 100644 --- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs @@ -73,9 +73,9 @@ namespace WixToolset.Core.Burn private IVariableResolver VariableResolver { get; } - public IEnumerable FileTransfers { get; private set; } + public IReadOnlyCollection FileTransfers { get; private set; } - public IEnumerable TrackedFiles { get; private set; } + public IReadOnlyCollection TrackedFiles { get; private set; } public WixOutput Wixout { get; private set; } diff --git a/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs b/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs index a4f37d10..e4d2b0c9 100644 --- a/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs +++ b/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs @@ -46,7 +46,7 @@ namespace WixToolset.Core.Burn.ExtensibilityServices public IResolvedDirectory CreateResolvedDirectory(string directoryParent, string name) => this.backendHelper.CreateResolvedDirectory(directoryParent, name); - public IEnumerable ExtractEmbeddedFiles(IEnumerable embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); + public IReadOnlyList ExtractEmbeddedFiles(IEnumerable embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); public string GenerateIdentifier(string prefix, params string[] args) => this.backendHelper.GenerateIdentifier(prefix, args); diff --git a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs index 76587830..2a603adf 100644 --- a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs +++ b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs @@ -21,7 +21,7 @@ namespace WixToolset.Core.ExtensionCache private IServiceProvider ServiceProvider { get; } - public override IEnumerable CommandLineSwitches => new ExtensionCommandLineSwitch[] + public override IReadOnlyCollection CommandLineSwitches => new ExtensionCommandLineSwitch[] { new ExtensionCommandLineSwitch { Switch = "extension", Description = "Manage extension cache." }, }; diff --git a/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs b/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs index ca1cd0e3..8305b5e6 100644 --- a/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs +++ b/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs @@ -37,7 +37,7 @@ namespace WixToolset.Core.WindowsInstaller.ExtensibilityServices public IResolvedDirectory CreateResolvedDirectory(string directoryParent, string name) => this.backendHelper.CreateResolvedDirectory(directoryParent, name); - public IEnumerable ExtractEmbeddedFiles(IEnumerable embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); + public IReadOnlyList ExtractEmbeddedFiles(IEnumerable embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); public string GenerateIdentifier(string prefix, params string[] args) => this.backendHelper.GenerateIdentifier(prefix, args); diff --git a/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs b/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs index 35c8a2f0..a0798e62 100644 --- a/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs +++ b/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs @@ -50,7 +50,7 @@ namespace WixToolset.Core.Bind return extractPath; } - public IEnumerable GetExpectedEmbeddedFiles() + public IReadOnlyList GetExpectedEmbeddedFiles() { var files = new List(); diff --git a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs index 981a991f..ec2d8896 100644 --- a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs +++ b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs @@ -17,7 +17,7 @@ namespace WixToolset.Core.Bind this.FilesWithEmbeddedFiles = embeddedFiles; } - public IEnumerable TrackedFiles { get; private set; } + public IReadOnlyList TrackedFiles { get; private set; } private IBackendHelper BackendHelper { get; } diff --git a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs index 2738ac6c..794208e5 100644 --- a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs +++ b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs @@ -36,7 +36,7 @@ namespace WixToolset.Core.Bind public bool AllowUnresolvedVariables { private get; set; } - public IEnumerable DelayedFields { get; private set; } + public IReadOnlyCollection DelayedFields { get; private set; } public void Execute() { diff --git a/src/WixToolset.Core/BindContext.cs b/src/WixToolset.Core/BindContext.cs index 09454824..052382f1 100644 --- a/src/WixToolset.Core/BindContext.cs +++ b/src/WixToolset.Core/BindContext.cs @@ -18,7 +18,7 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public IEnumerable BindPaths { get; set; } + public IReadOnlyCollection BindPaths { get; set; } public string BurnStubPath { get; set; } @@ -28,15 +28,15 @@ namespace WixToolset.Core public CompressionLevel? DefaultCompressionLevel { get; set; } - public IEnumerable DelayedFields { get; set; } + public IReadOnlyCollection DelayedFields { get; set; } - public IEnumerable ExpectedEmbeddedFiles { get; set; } + public IReadOnlyCollection ExpectedEmbeddedFiles { get; set; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } - public IEnumerable FileSystemExtensions { get; set; } + public IReadOnlyCollection FileSystemExtensions { get; set; } - public IEnumerable Ices { get; set; } + public IReadOnlyCollection Ices { get; set; } public string IntermediateFolder { get; set; } @@ -54,7 +54,7 @@ namespace WixToolset.Core public int? ResolvedLcid { get; set; } - public IEnumerable SuppressIces { get; set; } + public IReadOnlyCollection SuppressIces { get; set; } public bool SuppressValidation { get; set; } diff --git a/src/WixToolset.Core/BindResult.cs b/src/WixToolset.Core/BindResult.cs index 4edade7a..9785484c 100644 --- a/src/WixToolset.Core/BindResult.cs +++ b/src/WixToolset.Core/BindResult.cs @@ -11,9 +11,9 @@ namespace WixToolset.Core { private bool disposed; - public IEnumerable FileTransfers { get; set; } + public IReadOnlyCollection FileTransfers { get; set; } - public IEnumerable TrackedFiles { get; set; } + public IReadOnlyCollection TrackedFiles { get; set; } public WixOutput Wixout { get; set; } diff --git a/src/WixToolset.Core/Binder.cs b/src/WixToolset.Core/Binder.cs index 090b5d32..204ab6ee 100644 --- a/src/WixToolset.Core/Binder.cs +++ b/src/WixToolset.Core/Binder.cs @@ -58,7 +58,7 @@ namespace WixToolset.Core var backendFactories = extensionManager.GetServices(); - var entrySection = context.IntermediateRepresentation.Sections[0]; + var entrySection = context.IntermediateRepresentation.Sections.First(); foreach (var factory in backendFactories) { diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 59aa2f1f..5f618b81 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs @@ -216,7 +216,7 @@ namespace WixToolset.Core.CommandLine } } - private IEnumerable CompilePhase(IDictionary preprocessorVariables, IEnumerable sourceFiles, CancellationToken cancellationToken) + private IReadOnlyList CompilePhase(IDictionary preprocessorVariables, IEnumerable sourceFiles, CancellationToken cancellationToken) { var intermediates = new List(); @@ -257,7 +257,7 @@ namespace WixToolset.Core.CommandLine return intermediates; } - private Intermediate LibraryPhase(IEnumerable intermediates, IEnumerable localizations, bool bindFiles, IEnumerable bindPaths, CancellationToken cancellationToken) + private Intermediate LibraryPhase(IReadOnlyCollection intermediates, IReadOnlyCollection localizations, bool bindFiles, IReadOnlyCollection bindPaths, CancellationToken cancellationToken) { var context = this.ServiceProvider.GetService(); context.BindFiles = bindFiles; @@ -302,7 +302,7 @@ namespace WixToolset.Core.CommandLine return linker.Link(context); } - private void BindPhase(Intermediate output, IEnumerable localizations, IEnumerable filterCultures, string cabCachePath, IEnumerable bindPaths, CancellationToken cancellationToken) + private void BindPhase(Intermediate output, IReadOnlyCollection localizations, IReadOnlyCollection filterCultures, string cabCachePath, IReadOnlyCollection bindPaths, CancellationToken cancellationToken) { var intermediateFolder = this.IntermediateFolder; if (String.IsNullOrEmpty(intermediateFolder)) @@ -405,7 +405,7 @@ namespace WixToolset.Core.CommandLine return Array.Empty(); } - private IEnumerable LoadLocalizationFiles(IEnumerable locFiles, IDictionary preprocessorVariables, CancellationToken cancellationToken) + private IReadOnlyList LoadLocalizationFiles(IEnumerable locFiles, IDictionary preprocessorVariables, CancellationToken cancellationToken) { var localizations = new List(); var parser = this.ServiceProvider.GetService(); @@ -787,7 +787,7 @@ namespace WixToolset.Core.CommandLine return Data.OutputType.Unknown; } - public IEnumerable CalculateFilterCultures() + public IReadOnlyList CalculateFilterCultures() { var result = new List(); diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs index 54d1b6f1..6e31b241 100644 --- a/src/WixToolset.Core/CommandLine/CompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs @@ -42,7 +42,7 @@ namespace WixToolset.Core.CommandLine private Platform Platform { get; } - public IEnumerable IncludeSearchPaths { get; } + public IReadOnlyCollection IncludeSearchPaths { get; } public bool ShowLogo => throw new NotImplementedException(); diff --git a/src/WixToolset.Core/CompileContext.cs b/src/WixToolset.Core/CompileContext.cs index 2aeb3998..d84d7aac 100644 --- a/src/WixToolset.Core/CompileContext.cs +++ b/src/WixToolset.Core/CompileContext.cs @@ -21,7 +21,7 @@ namespace WixToolset.Core public string CompilationId { get; set; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } public Platform Platform { get; set; } diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index 8705cacd..727084eb 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs @@ -1048,7 +1048,7 @@ namespace WixToolset.Core { var section = new IntermediateSection(id, type, compilationId); - this.intermediate.Sections.Add(section); + this.intermediate.AddSection(section); return section; } diff --git a/src/WixToolset.Core/DecompileContext.cs b/src/WixToolset.Core/DecompileContext.cs index 056785d6..a7ec03fd 100644 --- a/src/WixToolset.Core/DecompileContext.cs +++ b/src/WixToolset.Core/DecompileContext.cs @@ -22,7 +22,7 @@ namespace WixToolset.Core public OutputType DecompileType { get; set; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } public string ExtractFolder { get; set; } diff --git a/src/WixToolset.Core/DecompileResult.cs b/src/WixToolset.Core/DecompileResult.cs index 8c9285ba..fc24cab7 100644 --- a/src/WixToolset.Core/DecompileResult.cs +++ b/src/WixToolset.Core/DecompileResult.cs @@ -11,7 +11,7 @@ namespace WixToolset.Core { public XDocument Document { get; set; } - public IEnumerable ExtractedFilePaths { get; set; } + public IReadOnlyCollection ExtractedFilePaths { get; set; } public Platform? Platform { get; set; } } diff --git a/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs b/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs index 539cec78..cfa78623 100644 --- a/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs @@ -73,7 +73,7 @@ namespace WixToolset.Core.ExtensibilityServices }; } - public IEnumerable ExtractEmbeddedFiles(IEnumerable embeddedFiles) + public IReadOnlyList ExtractEmbeddedFiles(IEnumerable embeddedFiles) { var command = new ExtractEmbeddedFilesCommand(this, embeddedFiles); command.Execute(); diff --git a/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs index 31184c33..2340ed9e 100644 --- a/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs +++ b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs @@ -94,7 +94,7 @@ namespace WixToolset.Core.ExtensibilityServices } } - public IEnumerable GetServices() where T : class + public IReadOnlyCollection GetServices() where T : class { if (!this.loadedExtensionsByType.TryGetValue(typeof(T), out var extensions)) { diff --git a/src/WixToolset.Core/LayoutContext.cs b/src/WixToolset.Core/LayoutContext.cs index deb5057f..4b8c7b99 100644 --- a/src/WixToolset.Core/LayoutContext.cs +++ b/src/WixToolset.Core/LayoutContext.cs @@ -17,13 +17,13 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } - public IEnumerable FileSystemExtensions { get; set; } + public IReadOnlyCollection FileSystemExtensions { get; set; } - public IEnumerable FileTransfers { get; set; } + public IReadOnlyCollection FileTransfers { get; set; } - public IEnumerable TrackedFiles { get; set; } + public IReadOnlyCollection TrackedFiles { get; set; } public string IntermediateFolder { get; set; } diff --git a/src/WixToolset.Core/LibraryContext.cs b/src/WixToolset.Core/LibraryContext.cs index 62d4e70c..e701cadf 100644 --- a/src/WixToolset.Core/LibraryContext.cs +++ b/src/WixToolset.Core/LibraryContext.cs @@ -23,15 +23,15 @@ namespace WixToolset.Core public bool BindFiles { get; set; } - public IEnumerable BindPaths { get; set; } + public IReadOnlyCollection BindPaths { get; set; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } public string LibraryId { get; set; } - public IEnumerable Localizations { get; set; } + public IReadOnlyCollection Localizations { get; set; } - public IEnumerable Intermediates { get; set; } + public IReadOnlyCollection Intermediates { get; set; } public CancellationToken CancellationToken { get; set; } } diff --git a/src/WixToolset.Core/LinkContext.cs b/src/WixToolset.Core/LinkContext.cs index 528d0f0f..b99bb9c4 100644 --- a/src/WixToolset.Core/LinkContext.cs +++ b/src/WixToolset.Core/LinkContext.cs @@ -8,7 +8,6 @@ namespace WixToolset.Core using WixToolset.Data; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; internal class LinkContext : ILinkContext { @@ -19,13 +18,13 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } - public IEnumerable ExtensionData { get; set; } + public IReadOnlyCollection ExtensionData { get; set; } public OutputType ExpectedOutputType { get; set; } - public IEnumerable Intermediates { get; set; } + public IReadOnlyCollection Intermediates { get; set; } public ISymbolDefinitionCreator SymbolDefinitionCreator { get; set; } diff --git a/src/WixToolset.Core/PreprocessContext.cs b/src/WixToolset.Core/PreprocessContext.cs index 0b735a7c..986045ff 100644 --- a/src/WixToolset.Core/PreprocessContext.cs +++ b/src/WixToolset.Core/PreprocessContext.cs @@ -18,11 +18,11 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } public Platform Platform { get; set; } - public IEnumerable IncludeSearchPaths { get; set; } + public IReadOnlyCollection IncludeSearchPaths { get; set; } public string SourcePath { get; set; } diff --git a/src/WixToolset.Core/PreprocessResult.cs b/src/WixToolset.Core/PreprocessResult.cs index 7126f049..83b29a90 100644 --- a/src/WixToolset.Core/PreprocessResult.cs +++ b/src/WixToolset.Core/PreprocessResult.cs @@ -10,6 +10,6 @@ namespace WixToolset.Core { public XDocument Document { get; set; } - public IEnumerable IncludedFiles { get; set; } + public IReadOnlyCollection IncludedFiles { get; set; } } } diff --git a/src/WixToolset.Core/ResolveContext.cs b/src/WixToolset.Core/ResolveContext.cs index 185b556c..638c8079 100644 --- a/src/WixToolset.Core/ResolveContext.cs +++ b/src/WixToolset.Core/ResolveContext.cs @@ -19,19 +19,19 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public IEnumerable BindPaths { get; set; } + public IReadOnlyCollection BindPaths { get; set; } - public IEnumerable Extensions { get; set; } + public IReadOnlyCollection Extensions { get; set; } - public IEnumerable ExtensionData { get; set; } + public IReadOnlyCollection ExtensionData { get; set; } - public IEnumerable FilterCultures { get; set; } + public IReadOnlyCollection FilterCultures { get; set; } public string IntermediateFolder { get; set; } public Intermediate IntermediateRepresentation { get; set; } - public IEnumerable Localizations { get; set; } + public IReadOnlyCollection Localizations { get; set; } public IVariableResolver VariableResolver { get; set; } diff --git a/src/WixToolset.Core/ResolveFileResult.cs b/src/WixToolset.Core/ResolveFileResult.cs index 12b31d54..f6e201d4 100644 --- a/src/WixToolset.Core/ResolveFileResult.cs +++ b/src/WixToolset.Core/ResolveFileResult.cs @@ -9,6 +9,6 @@ namespace WixToolset.Core { public string Path { get; set; } - public IEnumerable CheckedPaths { get; set; } + public IReadOnlyCollection CheckedPaths { get; set; } } } diff --git a/src/WixToolset.Core/ResolveResult.cs b/src/WixToolset.Core/ResolveResult.cs index 38b432b0..fa8e09b7 100644 --- a/src/WixToolset.Core/ResolveResult.cs +++ b/src/WixToolset.Core/ResolveResult.cs @@ -14,9 +14,9 @@ namespace WixToolset.Core public int? PackageLcid { get; set; } - public IEnumerable DelayedFields { get; set; } + public IReadOnlyCollection DelayedFields { get; set; } - public IEnumerable ExpectedEmbeddedFiles { get; set; } + public IReadOnlyCollection ExpectedEmbeddedFiles { get; set; } public Intermediate IntermediateRepresentation { get; set; } } diff --git a/src/WixToolset.Core/Resolver.cs b/src/WixToolset.Core/Resolver.cs index f4cb2fd6..e93f8e1b 100644 --- a/src/WixToolset.Core/Resolver.cs +++ b/src/WixToolset.Core/Resolver.cs @@ -77,7 +77,7 @@ namespace WixToolset.Core var filesWithEmbeddedFiles = new ExtractEmbeddedFiles(); - IEnumerable delayedFields; + IReadOnlyCollection delayedFields; { var command = new ResolveFieldsCommand(); command.Messaging = this.Messaging; diff --git a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs index 49f68de5..7244798a 100644 --- a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs +++ b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs @@ -12,7 +12,7 @@ namespace Example.Extension { private string exampleValueFromCommandLine; - public IEnumerable CommandLineSwitches => throw new NotImplementedException(); + public IReadOnlyCollection CommandLineSwitches => throw new NotImplementedException(); public ExamplePreprocessorExtensionAndCommandLine() { diff --git a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs index 87b7855c..afccc56f 100644 --- a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs +++ b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs @@ -9,7 +9,7 @@ namespace Example.Extension internal class ExampleWindowsInstallerBackendExtension : BaseWindowsInstallerBackendBinderExtension { - public override IEnumerable TableDefinitions => ExampleTableDefinitions.All; + public override IReadOnlyCollection TableDefinitions => ExampleTableDefinitions.All; public override bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) { diff --git a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs index 676d7d87..cfe4d3f1 100644 --- a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs @@ -3,6 +3,7 @@ namespace WixToolsetTest.CoreIntegration { + using System; using System.IO; using System.Linq; using WixBuildTools.TestSupport; @@ -29,8 +30,8 @@ namespace WixToolsetTest.CoreIntegration var creator = serviceProvider.GetService(); var context = serviceProvider.GetService(); - context.Extensions = Enumerable.Empty(); - context.ExtensionData = Enumerable.Empty(); + context.Extensions = Array.Empty(); + context.ExtensionData = Array.Empty(); context.Intermediates = new[] { intermediate1, intermediate2 }; context.SymbolDefinitionCreator = creator; -- cgit v1.2.3-55-g6feb