From b3531b23b835e19b4c15483b0d156dbfc45cd789 Mon Sep 17 00:00:00 2001 From: andrewjsaid Date: Tue, 9 Jan 2018 15:34:07 +0100 Subject: [PATCH 1/2] Show correct missing key name in NoContextType error message --- .../Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs | 2 +- .../Properties/Strings.Designer.cs | 2 +- .../Strings.resx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs index e7749f488a..2381c31c09 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal private static readonly Action _noContextType = LoggerMessage.Define( LogLevel.Error, new EventId(1, "NoContextType"), - "No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for."); + "No context type was specified. Ensure the form data from the request includes a context value, specifying the context type name to apply migrations for."); private static readonly Action _invalidContextType = LoggerMessage.Define( LogLevel.Error, diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs index 3266d2f144..4540a949c7 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs @@ -277,7 +277,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore => string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_InvalidContextType"), p0); /// - /// No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for. + /// No context type was specified. Ensure the form data from the request includes a context value, specifying the context type name to apply migrations for. /// internal static string MigrationsEndPointMiddleware_NoContextType { diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx index 3f987c8716..26314d1062 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx @@ -175,7 +175,7 @@ The context type '{0}' could not be loaded. Ensure this is the correct type name for the context you are trying to apply migrations for. - No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for. + No context type was specified. Ensure the form data from the request includes a context value, specifying the context type name to apply migrations for. A database operation failed while processing the request. From af89bb661a42da18ed01cc951535b627a3eb1d00 Mon Sep 17 00:00:00 2001 From: Andrew J Said Date: Wed, 18 Jul 2018 12:24:22 +0100 Subject: [PATCH 2/2] Clarify error message as request in pull request review --- .../Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs | 2 +- .../Properties/Strings.Designer.cs | 2 +- .../Strings.resx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs index 2381c31c09..d7696a5bab 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal private static readonly Action _noContextType = LoggerMessage.Define( LogLevel.Error, new EventId(1, "NoContextType"), - "No context type was specified. Ensure the form data from the request includes a context value, specifying the context type name to apply migrations for."); + "No context type was specified. Ensure the form data from the request includes a 'context' value, specifying the context type name to apply migrations for."); private static readonly Action _invalidContextType = LoggerMessage.Define( LogLevel.Error, diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs index 4540a949c7..c27dad8871 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs @@ -277,7 +277,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore => string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_InvalidContextType"), p0); /// - /// No context type was specified. Ensure the form data from the request includes a context value, specifying the context type name to apply migrations for. + /// No context type was specified. Ensure the form data from the request includes a 'context' value, specifying the context type name to apply migrations for. /// internal static string MigrationsEndPointMiddleware_NoContextType { diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx index 26314d1062..0c6bad1477 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx @@ -175,7 +175,7 @@ The context type '{0}' could not be loaded. Ensure this is the correct type name for the context you are trying to apply migrations for. - No context type was specified. Ensure the form data from the request includes a context value, specifying the context type name to apply migrations for. + No context type was specified. Ensure the form data from the request includes a 'context' value, specifying the context type name to apply migrations for. A database operation failed while processing the request.