aspnet / Diagnostics

[Archived] Diagnostics middleware for reporting info and handling exceptions and errors in ASP.NET Core, and diagnosing Entity Framework Core migrations errors. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
213 stars 108 forks source link

Show correct missing key name in NoContextType error message #431

Closed andrewjsaid closed 6 years ago

andrewjsaid commented 6 years ago

The MigrationsEndPointMiddleware class (/dev/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointMiddleware.cs) requires a "context" form value in the form-data, but if missing complains with the error message:

No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for.

This error message is misleading as one would expect that the request key must be "contextTypeName". I only figured out what it must be by exploring the source code.

This commit changes the message to display a clearer error message; specifically mentioning the context key as follows:

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.

dnfclas commented 6 years ago

CLA assistant check
All CLA requirements met.

davidfowl commented 6 years ago

/cc @anpete

Eilon commented 6 years ago

And cc @ajcvickers

pranavkm commented 6 years ago

cc @ajcvickers