From b9565b9ba3297fd342cd9f8fbfbe86ea440bff9e Mon Sep 17 00:00:00 2001 From: Rowan Miller Date: Mon, 9 May 2016 14:57:24 -0700 Subject: [PATCH] Include instructions for PMC migrations commands Update database error page to include instructions for using Package Manager Console commands to add/apply migrations. Resolves #290 --- .../Properties/Strings.Designer.cs | 132 ++++++++++++++---- .../Strings.resx | 31 ++-- .../Views/DatabaseErrorPage.cs | 112 ++++++++++----- .../Views/DatabaseErrorPage.cshtml | 28 ++-- src/PageGenerator/Program.cs | 2 +- src/PageGenerator/project.json | 59 ++++---- .../DatabaseErrorPageMiddlewareTest.cs | 10 +- .../DatabaseErrorPageSampleTest.cs | 2 +- 8 files changed, 265 insertions(+), 111 deletions(-) diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs index 5c4ad39df4..77fefd57c5 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs @@ -77,17 +77,17 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore /// /// > dotnet ef migrations add [migration name] /// - internal static string DatabaseErrorPage_AddMigrationCommand + internal static string DatabaseErrorPage_AddMigrationCommandCLI { - get { return GetString("DatabaseErrorPage_AddMigrationCommand"); } + get { return GetString("DatabaseErrorPage_AddMigrationCommandCLI"); } } /// /// > dotnet ef migrations add [migration name] /// - internal static string FormatDatabaseErrorPage_AddMigrationCommand() + internal static string FormatDatabaseErrorPage_AddMigrationCommandCLI() { - return GetString("DatabaseErrorPage_AddMigrationCommand"); + return GetString("DatabaseErrorPage_AddMigrationCommandCLI"); } /// @@ -155,19 +155,19 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore } /// - /// You can also apply migrations from the command line: + /// In Visual Studio, you can use Package Manager Console apply pending migrations to the database: /// - internal static string DatabaseErrorPage_HowToApplyFromCmd + internal static string DatabaseErrorPage_HowToApplyFromPMC { - get { return GetString("DatabaseErrorPage_HowToApplyFromCmd"); } + get { return GetString("DatabaseErrorPage_HowToApplyFromPMC"); } } /// - /// You can also apply migrations from the command line: + /// In Visual Studio, you can use Package Manager Console apply pending migrations to the database: /// - internal static string FormatDatabaseErrorPage_HowToApplyFromCmd() + internal static string FormatDatabaseErrorPage_HowToApplyFromPMC() { - return GetString("DatabaseErrorPage_HowToApplyFromCmd"); + return GetString("DatabaseErrorPage_HowToApplyFromPMC"); } /// @@ -187,19 +187,19 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore } /// - /// From the command line, scaffold a new migration and apply it to the database: + /// In Visual Studio, use Package Manager Console to scaffold a new migration and apply it to the database: /// - internal static string DatabaseErrorPage_NoDbOrMigrationsInfo + internal static string DatabaseErrorPage_NoDbOrMigrationsInfoPMC { - get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfo"); } + get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC"); } } /// - /// From the command line, scaffold a new migration and apply it to the database: + /// In Visual Studio, use Package Manager Console to scaffold a new migration and apply it to the database: /// - internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfo() + internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfoPMC() { - return GetString("DatabaseErrorPage_NoDbOrMigrationsInfo"); + return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC"); } /// @@ -219,19 +219,19 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore } /// - /// Scaffold a new migration for these changes and apply them to the database from the command line: + /// In Visual Studio, use Package Manager Console to scaffold a new migration for these changes and apply them to the database: /// - internal static string DatabaseErrorPage_PendingChangesInfo + internal static string DatabaseErrorPage_PendingChangesInfoPMC { - get { return GetString("DatabaseErrorPage_PendingChangesInfo"); } + get { return GetString("DatabaseErrorPage_PendingChangesInfoPMC"); } } /// - /// Scaffold a new migration for these changes and apply them to the database from the command line: + /// In Visual Studio, use Package Manager Console to scaffold a new migration for these changes and apply them to the database: /// - internal static string FormatDatabaseErrorPage_PendingChangesInfo() + internal static string FormatDatabaseErrorPage_PendingChangesInfoPMC() { - return GetString("DatabaseErrorPage_PendingChangesInfo"); + return GetString("DatabaseErrorPage_PendingChangesInfoPMC"); } /// @@ -285,17 +285,17 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore /// /// > dotnet ef database update /// - internal static string DatabaseErrorPage_ApplyMigrationsCommand + internal static string DatabaseErrorPage_ApplyMigrationsCommandCLI { - get { return GetString("DatabaseErrorPage_ApplyMigrationsCommand"); } + get { return GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI"); } } /// /// > dotnet ef database update /// - internal static string FormatDatabaseErrorPage_ApplyMigrationsCommand() + internal static string FormatDatabaseErrorPage_ApplyMigrationsCommandCLI() { - return GetString("DatabaseErrorPage_ApplyMigrationsCommand"); + return GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI"); } /// @@ -522,6 +522,86 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore return GetString("DatabaseErrorPage_NoMatch"); } + /// + /// PM> Add-Migration [migration name] + /// + internal static string DatabaseErrorPage_AddMigrationCommandPMC + { + get { return GetString("DatabaseErrorPage_AddMigrationCommandPMC"); } + } + + /// + /// PM> Add-Migration [migration name] + /// + internal static string FormatDatabaseErrorPage_AddMigrationCommandPMC() + { + return GetString("DatabaseErrorPage_AddMigrationCommandPMC"); + } + + /// + /// PM> Update-Database + /// + internal static string DatabaseErrorPage_ApplyMigrationsCommandPMC + { + get { return GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC"); } + } + + /// + /// PM> Update-Database + /// + internal static string FormatDatabaseErrorPage_ApplyMigrationsCommandPMC() + { + return GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC"); + } + + /// + /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory: + /// + internal static string DatabaseErrorPage_NoDbOrMigrationsInfoCLI + { + get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI"); } + } + + /// + /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory: + /// + internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfoCLI() + { + return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI"); + } + + /// + /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory: + /// + internal static string DatabaseErrorPage_PendingChangesInfoCLI + { + get { return GetString("DatabaseErrorPage_PendingChangesInfoCLI"); } + } + + /// + /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory: + /// + internal static string FormatDatabaseErrorPage_PendingChangesInfoCLI() + { + return GetString("DatabaseErrorPage_PendingChangesInfoCLI"); + } + + /// + /// Alternatively, you can apply pending migrations from a command prompt at your project directory: + /// + internal static string DatabaseErrorPage_HowToApplyFromCLI + { + get { return GetString("DatabaseErrorPage_HowToApplyFromCLI"); } + } + + /// + /// Alternatively, you can apply pending migrations from a command prompt at your project directory: + /// + internal static string FormatDatabaseErrorPage_HowToApplyFromCLI() + { + return GetString("DatabaseErrorPage_HowToApplyFromCLI"); + } + private static string GetString(string name, params string[] formatterNames) { var value = _resourceManager.GetString(name); diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx index 1a7d2359a5..92de6f0740 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx @@ -129,7 +129,7 @@ An exception occurred while calculating the database error page content. Skipping display of the database error page. - + > dotnet ef migrations add [migration name] @@ -144,20 +144,20 @@ An error occurred applying migrations, try applying them from the command line - - You can also apply migrations from the command line: + + In Visual Studio, you can use the Package Manager Console to apply pending migrations to the database: Try refreshing the page - - From the command line, scaffold a new migration and apply it to the database: + + In Visual Studio, use the Package Manager Console to scaffold a new migration and apply it to the database: Use migrations to create the database for {0} - - Scaffold a new migration for these changes and apply them to the database from the command line: + + In Visual Studio, use the Package Manager Console to scaffold a new migration for these changes and apply them to the database: There are pending model changes for {0} @@ -168,7 +168,7 @@ Applying existing migrations for {0} may resolve this issue - + > dotnet ef database update @@ -213,4 +213,19 @@ The current exception (and its inner exceptions) do not match the last exception Entity Framework recorded due to a failed database operation. This means the database operation exception was handled and another exception occurred later in the request. + + PM> Add-Migration [migration name] + + + PM> Update-Database + + + Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory: + + + Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory: + + + Alternatively, you can apply pending migrations from a command prompt at your project directory: + \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs index 468415eb03..95820eb3dd 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs @@ -122,24 +122,42 @@ using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views #line hidden WriteLiteral("\r\n

"); #line 48 "DatabaseErrorPage.cshtml" - Write(Strings.DatabaseErrorPage_NoDbOrMigrationsInfo); + Write(Strings.DatabaseErrorPage_NoDbOrMigrationsInfoPMC); #line default #line hidden WriteLiteral("

\r\n "); #line 49 "DatabaseErrorPage.cshtml" - Write(Strings.DatabaseErrorPage_AddMigrationCommand); + Write(Strings.DatabaseErrorPage_AddMigrationCommandPMC); #line default #line hidden - WriteLiteral(" \r\n
\r\n "); + WriteLiteral("\r\n
\r\n "); #line 51 "DatabaseErrorPage.cshtml" - Write(Strings.DatabaseErrorPage_ApplyMigrationsCommand); + Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC); #line default #line hidden - WriteLiteral(" \r\n
\r\n"); + WriteLiteral("\r\n

"); +#line 52 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_NoDbOrMigrationsInfoCLI); + +#line default +#line hidden + WriteLiteral("

\r\n "); #line 53 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_AddMigrationCommandCLI); + +#line default +#line hidden + WriteLiteral("\r\n
\r\n "); +#line 55 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI); + +#line default +#line hidden + WriteLiteral("\r\n
\r\n"); +#line 57 "DatabaseErrorPage.cshtml" } else if (Model.PendingMigrations.Any()) { @@ -148,25 +166,25 @@ using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views #line hidden WriteLiteral("
\r\n

"); -#line 57 "DatabaseErrorPage.cshtml" +#line 61 "DatabaseErrorPage.cshtml" Write(Strings.FormatDatabaseErrorPage_PendingMigrationsTitle(Model.ContextType.Name)); #line default #line hidden WriteLiteral("

\r\n

"); -#line 58 "DatabaseErrorPage.cshtml" +#line 62 "DatabaseErrorPage.cshtml" Write(Strings.FormatDatabaseErrorPage_PendingMigrationsInfo(Model.ContextType.Name)); #line default #line hidden WriteLiteral("

\r\n\r\n
    \r\n"); -#line 61 "DatabaseErrorPage.cshtml" +#line 65 "DatabaseErrorPage.cshtml" #line default #line hidden -#line 61 "DatabaseErrorPage.cshtml" +#line 65 "DatabaseErrorPage.cshtml" foreach (var migration in Model.PendingMigrations) { @@ -174,20 +192,20 @@ using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views #line hidden WriteLiteral("
  • "); -#line 63 "DatabaseErrorPage.cshtml" +#line 67 "DatabaseErrorPage.cshtml" Write(migration); #line default #line hidden WriteLiteral("
  • \r\n"); -#line 64 "DatabaseErrorPage.cshtml" +#line 68 "DatabaseErrorPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n\r\n

\r\n

\r\n"); -#line 112 "DatabaseErrorPage.cshtml" +#line 118 "DatabaseErrorPage.cshtml" } else if (Model.PendingModelChanges) { @@ -282,31 +312,49 @@ using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views #line hidden WriteLiteral("
\r\n

"); -#line 116 "DatabaseErrorPage.cshtml" +#line 122 "DatabaseErrorPage.cshtml" Write(Strings.FormatDatabaseErrorPage_PendingChangesTitle(Model.ContextType.Name)); #line default #line hidden WriteLiteral("

\r\n

"); -#line 117 "DatabaseErrorPage.cshtml" - Write(Strings.DatabaseErrorPage_PendingChangesInfo); +#line 123 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_PendingChangesInfoPMC); #line default #line hidden WriteLiteral("

\r\n "); -#line 118 "DatabaseErrorPage.cshtml" - Write(Strings.DatabaseErrorPage_AddMigrationCommand); +#line 124 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_AddMigrationCommandPMC); #line default #line hidden WriteLiteral("\r\n
\r\n "); -#line 120 "DatabaseErrorPage.cshtml" - Write(Strings.DatabaseErrorPage_ApplyMigrationsCommand); +#line 126 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC); + +#line default +#line hidden + WriteLiteral("\r\n

"); +#line 127 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_PendingChangesInfoCLI); + +#line default +#line hidden + WriteLiteral("

\r\n "); +#line 128 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_AddMigrationCommandCLI); + +#line default +#line hidden + WriteLiteral("\r\n
\r\n "); +#line 130 "DatabaseErrorPage.cshtml" + Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI); #line default #line hidden WriteLiteral("\r\n
\r\n
\r\n"); -#line 123 "DatabaseErrorPage.cshtml" +#line 133 "DatabaseErrorPage.cshtml" } #line default diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cshtml index a75e67dfb0..c790b461eb 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cshtml +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cshtml @@ -1,4 +1,4 @@ -@using System +@using System @using System.Linq @using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore @using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views @@ -45,10 +45,14 @@ @if (!Model.DatabaseExists && !Model.PendingMigrations.Any()) {

@Strings.FormatDatabaseErrorPage_NoDbOrMigrationsTitle(Model.ContextType.Name)

-

@Strings.DatabaseErrorPage_NoDbOrMigrationsInfo

- @Strings.DatabaseErrorPage_AddMigrationCommand +

@Strings.DatabaseErrorPage_NoDbOrMigrationsInfoPMC

+ @Strings.DatabaseErrorPage_AddMigrationCommandPMC
- @Strings.DatabaseErrorPage_ApplyMigrationsCommand + @Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC +

@Strings.DatabaseErrorPage_NoDbOrMigrationsInfoCLI

+ @Strings.DatabaseErrorPage_AddMigrationCommandCLI +
+ @Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI
} else if (Model.PendingMigrations.Any()) @@ -105,8 +109,10 @@ } -

@Strings.DatabaseErrorPage_HowToApplyFromCmd

- @Strings.DatabaseErrorPage_ApplyMigrationsCommand +

@Strings.DatabaseErrorPage_HowToApplyFromPMC

+ @Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC +

@Strings.DatabaseErrorPage_HowToApplyFromCLI

+ @Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI
} @@ -114,10 +120,14 @@ {

@Strings.FormatDatabaseErrorPage_PendingChangesTitle(Model.ContextType.Name)

-

@Strings.DatabaseErrorPage_PendingChangesInfo

- @Strings.DatabaseErrorPage_AddMigrationCommand +

@Strings.DatabaseErrorPage_PendingChangesInfoPMC

+ @Strings.DatabaseErrorPage_AddMigrationCommandPMC
- @Strings.DatabaseErrorPage_ApplyMigrationsCommand + @Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC +

@Strings.DatabaseErrorPage_PendingChangesInfoCLI

+ @Strings.DatabaseErrorPage_AddMigrationCommandCLI +
+ @Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI
} diff --git a/src/PageGenerator/Program.cs b/src/PageGenerator/Program.cs index 7afa2b069b..c2f3beaecc 100644 --- a/src/PageGenerator/Program.cs +++ b/src/PageGenerator/Program.cs @@ -14,7 +14,7 @@ namespace PageGenerator { private const int NumArgs = 1; - public void Main(string[] args) + public static void Main(string[] args) { if (args.Length != NumArgs) { diff --git a/src/PageGenerator/project.json b/src/PageGenerator/project.json index 5e25de1450..5333ff53ec 100644 --- a/src/PageGenerator/project.json +++ b/src/PageGenerator/project.json @@ -1,30 +1,31 @@ -{ - "version": "1.0.0-*", - "description": "Builds the pages for the Diagnostics projects. Runs in build.cmd.", - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" - }, - "packOptions": { - "repository": { - "type": "git", - "url": "git://github.com/aspnet/diagnostics" - } - }, - "dependencies": { - "Microsoft.AspNetCore.Razor": "1.0.0-*" - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0-*", - "type": "platform" - } - } - } - }, - "commands": { - "run": "PageGenerator" - } +{ + "version": "1.0.0-*", + "description": "Builds the pages for the Diagnostics projects. Runs in build.cmd.", + "buildOptions": { + "emitEntryPoint": true, + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, + "packOptions": { + "repository": { + "type": "git", + "url": "git://github.com/aspnet/diagnostics" + } + }, + "dependencies": { + "Microsoft.AspNetCore.Razor": "1.0.0-*" + }, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + } + } + } + }, + "commands": { + "run": "PageGenerator" + } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs index 287f7aff1c..3719049010 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs +++ b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs @@ -115,8 +115,8 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); var content = await response.Content.ReadAsStringAsync(); Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_NoDbOrMigrationsTitle", typeof(BloggingContext).Name), content); - Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_AddMigrationCommand").Replace(">", ">"), content); - Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_ApplyMigrationsCommand").Replace(">", ">"), content); + Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_AddMigrationCommandPMC").Replace(">", ">"), content); + Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_ApplyMigrationsCommandPMC").Replace(">", ">"), content); } class NoMigrationsMiddleware @@ -144,11 +144,11 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests var content = await response.Content.ReadAsStringAsync(); Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_PendingMigrationsTitle", typeof(BloggingContextWithMigrations).Name), content); - Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_ApplyMigrationsCommand").Replace(">", ">"), content); + Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_ApplyMigrationsCommandPMC").Replace(">", ">"), content); Assert.Contains("
  • 111111111111111_MigrationOne
  • ", content); Assert.Contains("
  • 222222222222222_MigrationTwo
  • ", content); - Assert.DoesNotContain(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_AddMigrationCommand").Replace(">", ">"), content); + Assert.DoesNotContain(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_AddMigrationCommandPMC").Replace(">", ">"), content); } class PendingMigrationsMiddleware @@ -457,4 +457,4 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests return _javaScriptEncoder.Encode(content); } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs index 822fe8970b..acb68868b1 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs +++ b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Diagnostics.FunctionalTests // Assert var body = await response.Content.ReadAsStringAsync(); Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); - Assert.Contains("From the command line, scaffold a new migration and apply it to the database:", body); + Assert.Contains("In Visual Studio, use the Package Manager Console to scaffold a new migration and apply it to the database:", body); } } }