Replace static Enumerable.Concat() with instace IEnumerable.Concat()

This commit is contained in:
Mike Harder 2018-05-09 12:04:24 -07:00
parent af8152f80e
commit a2a0d6e344
12 changed files with 170 additions and 136 deletions

View File

@ -10,7 +10,9 @@ namespace AspNetCoreSdkTests.Templates
public override string Name => "angular"; public override string Name => "angular";
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[] public override IEnumerable<string> ExpectedFilesAfterPublish =>
base.ExpectedFilesAfterPublish
.Concat(new[]
{ {
Path.Combine("wwwroot", "favicon.ico"), Path.Combine("wwwroot", "favicon.ico"),
Path.Combine("ClientApp", "dist", "3rdpartylicenses.txt"), Path.Combine("ClientApp", "dist", "3rdpartylicenses.txt"),

View File

@ -14,7 +14,9 @@ namespace AspNetCoreSdkTests.Templates
public override TemplateType Type => TemplateType.ClassLibrary; public override TemplateType Type => TemplateType.ClassLibrary;
public override IEnumerable<string> ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[] public override IEnumerable<string> ExpectedObjFilesAfterBuild =>
base.ExpectedObjFilesAfterBuild
.Concat(new[]
{ {
$"{Name}.AssemblyInfo.cs", $"{Name}.AssemblyInfo.cs",
$"{Name}.AssemblyInfoInputs.cache", $"{Name}.AssemblyInfoInputs.cache",

View File

@ -27,7 +27,8 @@ namespace AspNetCoreSdkTests.Templates
}; };
public override IEnumerable<string> ExpectedObjFilesAfterBuild => public override IEnumerable<string> ExpectedObjFilesAfterBuild =>
Enumerable.Concat(base.ExpectedObjFilesAfterBuild, _additionalObjFilesAfterBuild[RuntimeIdentifier]()); base.ExpectedObjFilesAfterBuild
.Concat(_additionalObjFilesAfterBuild[RuntimeIdentifier]());
private IDictionary<RuntimeIdentifier, Func<IEnumerable<string>>> _additionalBinFilesAfterBuild => private IDictionary<RuntimeIdentifier, Func<IEnumerable<string>>> _additionalBinFilesAfterBuild =>
new Dictionary<RuntimeIdentifier, Func<IEnumerable<string>>>() new Dictionary<RuntimeIdentifier, Func<IEnumerable<string>>>()
@ -38,7 +39,9 @@ namespace AspNetCoreSdkTests.Templates
$"{Name}.runtimeconfig.json", $"{Name}.runtimeconfig.json",
}.Select(p => Path.Combine(OutputPath, p)) }.Select(p => Path.Combine(OutputPath, p))
}, },
{ RuntimeIdentifier.Win_x64, () => Enumerable.Concat(_additionalBinFilesAfterBuild[RuntimeIdentifier.None](), new[] { RuntimeIdentifier.Win_x64, () =>
_additionalBinFilesAfterBuild[RuntimeIdentifier.None]()
.Concat(new[]
{ {
$"{Name}.exe", $"{Name}.exe",
"hostfxr.dll", "hostfxr.dll",
@ -48,7 +51,8 @@ namespace AspNetCoreSdkTests.Templates
}; };
public override IEnumerable<string> ExpectedBinFilesAfterBuild => public override IEnumerable<string> ExpectedBinFilesAfterBuild =>
Enumerable.Concat(base.ExpectedBinFilesAfterBuild, _additionalBinFilesAfterBuild[RuntimeIdentifier]()); base.ExpectedBinFilesAfterBuild
.Concat(_additionalBinFilesAfterBuild[RuntimeIdentifier]());
private IDictionary<RuntimeIdentifier, Func<IEnumerable<string>>> _additionalFilesAfterPublish => private IDictionary<RuntimeIdentifier, Func<IEnumerable<string>>> _additionalFilesAfterPublish =>
new Dictionary<RuntimeIdentifier, Func<IEnumerable<string>>>() new Dictionary<RuntimeIdentifier, Func<IEnumerable<string>>>()
@ -58,7 +62,9 @@ namespace AspNetCoreSdkTests.Templates
$"{Name}.runtimeconfig.json", $"{Name}.runtimeconfig.json",
} }
}, },
{ RuntimeIdentifier.Win_x64, () => Enumerable.Concat(_additionalFilesAfterPublish[RuntimeIdentifier.None](), new[] { RuntimeIdentifier.Win_x64, () =>
_additionalFilesAfterPublish[RuntimeIdentifier.None]()
.Concat(new[]
{ {
$"{Name}.exe", $"{Name}.exe",
"api-ms-win-core-console-l1-1-0.dll", "api-ms-win-core-console-l1-1-0.dll",
@ -278,7 +284,8 @@ namespace AspNetCoreSdkTests.Templates
}; };
public override IEnumerable<string> ExpectedFilesAfterPublish => public override IEnumerable<string> ExpectedFilesAfterPublish =>
Enumerable.Concat(base.ExpectedFilesAfterPublish, _additionalFilesAfterPublish[RuntimeIdentifier]()); base.ExpectedFilesAfterPublish
.Concat(_additionalFilesAfterPublish[RuntimeIdentifier]());
} }
} }

View File

@ -12,7 +12,9 @@ namespace AspNetCoreSdkTests.Templates
protected override string RazorPath => "Views"; protected override string RazorPath => "Views";
public override IEnumerable<string> ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[] public override IEnumerable<string> ExpectedObjFilesAfterBuild =>
base.ExpectedObjFilesAfterBuild
.Concat(new[]
{ {
Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"), Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"),
Path.Combine("Razor", RazorPath, "Home", "About.g.cshtml.cs"), Path.Combine("Razor", RazorPath, "Home", "About.g.cshtml.cs"),

View File

@ -17,7 +17,9 @@ namespace AspNetCoreSdkTests.Templates
Path.Combine("Razor", RazorPath, "_ViewImports.g.cshtml.cs"), Path.Combine("Razor", RazorPath, "_ViewImports.g.cshtml.cs"),
}.Select(p => Path.Combine(OutputPath, p)) }.Select(p => Path.Combine(OutputPath, p))
}, },
{ RuntimeIdentifier.Win_x64, () => Enumerable.Concat(_additionalObjFilesAfterBuild[RuntimeIdentifier.None](), new[] { RuntimeIdentifier.Win_x64, () =>
_additionalObjFilesAfterBuild[RuntimeIdentifier.None]()
.Concat(new[]
{ {
Path.Combine("netcoreapp2.1", RuntimeIdentifier.Path, "host", $"{Name}.exe"), Path.Combine("netcoreapp2.1", RuntimeIdentifier.Path, "host", $"{Name}.exe"),
}) })

View File

@ -6,7 +6,9 @@ namespace AspNetCoreSdkTests.Templates
{ {
public abstract class RazorBootstrapJQueryTemplate : RazorApplicationBaseTemplate public abstract class RazorBootstrapJQueryTemplate : RazorApplicationBaseTemplate
{ {
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[] public override IEnumerable<string> ExpectedFilesAfterPublish =>
base.ExpectedFilesAfterPublish
.Concat(new[]
{ {
Path.Combine("wwwroot", "favicon.ico"), Path.Combine("wwwroot", "favicon.ico"),
Path.Combine("wwwroot", "css", "site.css"), Path.Combine("wwwroot", "css", "site.css"),

View File

@ -256,7 +256,9 @@ namespace AspNetCoreSdkTests.Templates
private IDictionary<RuntimeIdentifier, Func<IEnumerable<string>>> _additionalFilesAfterPublish => private IDictionary<RuntimeIdentifier, Func<IEnumerable<string>>> _additionalFilesAfterPublish =>
new Dictionary<RuntimeIdentifier, Func<IEnumerable<string>>>() new Dictionary<RuntimeIdentifier, Func<IEnumerable<string>>>()
{ {
{ RuntimeIdentifier.None, () => Enumerable.Concat(_commonAdditionalFilesAfterPublish, new[] { RuntimeIdentifier.None, () =>
_commonAdditionalFilesAfterPublish
.Concat(new[]
{ {
Path.Combine("runtimes", "debian.8-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"), Path.Combine("runtimes", "debian.8-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "fedora.23-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"), Path.Combine("runtimes", "fedora.23-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
@ -295,7 +297,9 @@ namespace AspNetCoreSdkTests.Templates
Path.Combine("runtimes", "win", "lib", "netstandard2.0", "System.Security.Cryptography.Pkcs.dll"), Path.Combine("runtimes", "win", "lib", "netstandard2.0", "System.Security.Cryptography.Pkcs.dll"),
}) })
}, },
{ RuntimeIdentifier.Win_x64, () => Enumerable.Concat(_commonAdditionalFilesAfterPublish, new[] { RuntimeIdentifier.Win_x64, () =>
_commonAdditionalFilesAfterPublish
.Concat(new[]
{ {
"System.Collections.dll", "System.Collections.dll",
"System.Console.dll", "System.Console.dll",

View File

@ -12,7 +12,9 @@ namespace AspNetCoreSdkTests.Templates
protected override string RazorPath => "Pages"; protected override string RazorPath => "Pages";
public override IEnumerable<string> ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[] public override IEnumerable<string> ExpectedObjFilesAfterBuild =>
base.ExpectedObjFilesAfterBuild
.Concat(new[]
{ {
Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"), Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"),
Path.Combine("Razor", RazorPath, "About.g.cshtml.cs"), Path.Combine("Razor", RazorPath, "About.g.cshtml.cs"),

View File

@ -10,7 +10,9 @@ namespace AspNetCoreSdkTests.Templates
public override string Name => "react"; public override string Name => "react";
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[] public override IEnumerable<string> ExpectedFilesAfterPublish =>
base.ExpectedFilesAfterPublish
.Concat(new[]
{ {
Path.Combine("ClientApp", "build", "asset-manifest.json"), Path.Combine("ClientApp", "build", "asset-manifest.json"),
Path.Combine("ClientApp", "build", "favicon.ico"), Path.Combine("ClientApp", "build", "favicon.ico"),

View File

@ -8,7 +8,9 @@ namespace AspNetCoreSdkTests.Templates
{ {
protected override string RazorPath => "Pages"; protected override string RazorPath => "Pages";
public override IEnumerable<string> ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[] public override IEnumerable<string> ExpectedObjFilesAfterBuild =>
base.ExpectedObjFilesAfterBuild
.Concat(new[]
{ {
Path.Combine("Razor", RazorPath, "Error.g.cshtml.cs"), Path.Combine("Razor", RazorPath, "Error.g.cshtml.cs"),
}.Select(p => Path.Combine(OutputPath, p))); }.Select(p => Path.Combine(OutputPath, p)));

View File

@ -11,7 +11,9 @@ namespace AspNetCoreSdkTests.Templates
public override string RelativeUrl => "/api/values"; public override string RelativeUrl => "/api/values";
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[] public override IEnumerable<string> ExpectedFilesAfterPublish =>
base.ExpectedFilesAfterPublish
.Concat(new[]
{ {
"appsettings.Development.json", "appsettings.Development.json",
"appsettings.json", "appsettings.json",

View File

@ -13,7 +13,9 @@ namespace AspNetCoreSdkTests.Templates
public override TemplateType Type => TemplateType.WebApplication; public override TemplateType Type => TemplateType.WebApplication;
public override IEnumerable<string> ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[] public override IEnumerable<string> ExpectedObjFilesAfterBuild =>
base.ExpectedObjFilesAfterBuild
.Concat(new[]
{ {
$"{Name}.RazorAssemblyInfo.cache", $"{Name}.RazorAssemblyInfo.cache",
$"{Name}.RazorAssemblyInfo.cs", $"{Name}.RazorAssemblyInfo.cs",
@ -30,7 +32,9 @@ namespace AspNetCoreSdkTests.Templates
"web.config", "web.config",
} }
}, },
{ RuntimeIdentifier.Win_x64, () => Enumerable.Concat(_additionalFilesAfterPublish[RuntimeIdentifier.None](), new[] { RuntimeIdentifier.Win_x64, () =>
_additionalFilesAfterPublish[RuntimeIdentifier.None]()
.Concat(new[]
{ {
"Microsoft.AspNetCore.Antiforgery.dll", "Microsoft.AspNetCore.Antiforgery.dll",
"Microsoft.AspNetCore.Authentication.Abstractions.dll", "Microsoft.AspNetCore.Authentication.Abstractions.dll",
@ -204,6 +208,7 @@ namespace AspNetCoreSdkTests.Templates
}; };
public override IEnumerable<string> ExpectedFilesAfterPublish => public override IEnumerable<string> ExpectedFilesAfterPublish =>
Enumerable.Concat(base.ExpectedFilesAfterPublish, _additionalFilesAfterPublish[RuntimeIdentifier]()); base.ExpectedFilesAfterPublish
.Concat(_additionalFilesAfterPublish[RuntimeIdentifier]());
} }
} }