From bcead68f0cebf53c1c8fe4c1015cc6961f5a757c Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Sun, 17 Mar 2019 15:50:11 -0700 Subject: [PATCH] React to EntityFrameworkCore and AspNetCore-Tooling breaking changes - avoid `[Obsolete]` EF Core method - mirror recent `RazorIntegrationTestBase` changes in this repo --- .../Blazor/Build/test/RazorIntegrationTestBase.cs | 8 +++++--- .../FunctionalTests/DatabaseErrorPageMiddlewareTest.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Components/Blazor/Build/test/RazorIntegrationTestBase.cs b/src/Components/Blazor/Build/test/RazorIntegrationTestBase.cs index 33d0c93f7c..fc234e267c 100644 --- a/src/Components/Blazor/Build/test/RazorIntegrationTestBase.cs +++ b/src/Components/Blazor/Build/test/RazorIntegrationTestBase.cs @@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test LineEnding = "\n"; NormalizeSourceLineEndings = true; - DefaultBaseNamespace = "Test"; // Matches the default working directory + DefaultRootNamespace = "Test"; // Matches the default working directory DefaultFileName = "TestComponent.cshtml"; } @@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test internal virtual RazorConfiguration Configuration { get; } - internal virtual string DefaultBaseNamespace { get; } + internal virtual string DefaultRootNamespace { get; } internal virtual string DefaultFileName { get; } @@ -119,6 +119,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test { return RazorProjectEngine.Create(Configuration, FileSystem, b => { + b.SetRootNamespace(DefaultRootNamespace); + // Turn off checksums, we're testing code generation. b.Features.Add(new SuppressChecksum()); @@ -344,7 +346,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test { var assemblyResult = CompileToAssembly(DefaultFileName, cshtmlSource); - var componentFullTypeName = $"{DefaultBaseNamespace}.{Path.GetFileNameWithoutExtension(DefaultFileName)}"; + var componentFullTypeName = $"{DefaultRootNamespace}.{Path.GetFileNameWithoutExtension(DefaultFileName)}"; return CompileToComponent(assemblyResult, componentFullTypeName); } diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs index bc9764c339..8f3cc0b471 100644 --- a/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs @@ -103,7 +103,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests { var db = context.RequestServices.GetService(); db.Database.EnsureCreated(); - db.Database.ExecuteSqlCommand("ALTER TABLE dbo.Blogs DROP COLUMN Name"); + db.Database.ExecuteRawSql("ALTER TABLE dbo.Blogs DROP COLUMN Name"); db.Blogs.Add(new Blog()); db.SaveChanges();