React to EntityFrameworkCore and AspNetCore-Tooling breaking changes

- avoid `[Obsolete]` EF Core method
- mirror recent `RazorIntegrationTestBase` changes in this repo
This commit is contained in:
Doug Bunting 2019-03-17 15:50:11 -07:00 committed by Doug Bunting
parent cb864e64f2
commit bcead68f0c
2 changed files with 6 additions and 4 deletions

View File

@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
LineEnding = "\n"; LineEnding = "\n";
NormalizeSourceLineEndings = true; NormalizeSourceLineEndings = true;
DefaultBaseNamespace = "Test"; // Matches the default working directory DefaultRootNamespace = "Test"; // Matches the default working directory
DefaultFileName = "TestComponent.cshtml"; DefaultFileName = "TestComponent.cshtml";
} }
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
internal virtual RazorConfiguration Configuration { get; } internal virtual RazorConfiguration Configuration { get; }
internal virtual string DefaultBaseNamespace { get; } internal virtual string DefaultRootNamespace { get; }
internal virtual string DefaultFileName { get; } internal virtual string DefaultFileName { get; }
@ -119,6 +119,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{ {
return RazorProjectEngine.Create(Configuration, FileSystem, b => return RazorProjectEngine.Create(Configuration, FileSystem, b =>
{ {
b.SetRootNamespace(DefaultRootNamespace);
// Turn off checksums, we're testing code generation. // Turn off checksums, we're testing code generation.
b.Features.Add(new SuppressChecksum()); b.Features.Add(new SuppressChecksum());
@ -344,7 +346,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{ {
var assemblyResult = CompileToAssembly(DefaultFileName, cshtmlSource); var assemblyResult = CompileToAssembly(DefaultFileName, cshtmlSource);
var componentFullTypeName = $"{DefaultBaseNamespace}.{Path.GetFileNameWithoutExtension(DefaultFileName)}"; var componentFullTypeName = $"{DefaultRootNamespace}.{Path.GetFileNameWithoutExtension(DefaultFileName)}";
return CompileToComponent(assemblyResult, componentFullTypeName); return CompileToComponent(assemblyResult, componentFullTypeName);
} }

View File

@ -103,7 +103,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
{ {
var db = context.RequestServices.GetService<BloggingContext>(); var db = context.RequestServices.GetService<BloggingContext>();
db.Database.EnsureCreated(); 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.Blogs.Add(new Blog());
db.SaveChanges(); db.SaveChanges();