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:
parent
cb864e64f2
commit
bcead68f0c
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
|
|||
{
|
||||
var db = context.RequestServices.GetService<BloggingContext>();
|
||||
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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue