Use StatusCodes.Status404NotFound instead of 404 (#18453)

This is a minor change to improve consistency and use `StatusCodes` members instead of raw harcoded status code numbers. It may help beginners browsing through the code-base to find where the default 404 response comes from for unmatched requests.
This commit is contained in:
davidnx 2020-01-20 08:28:56 -08:00 committed by msftbot[bot]
parent c848c33cfa
commit 237b697320
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ namespace Microsoft.AspNetCore.Builder
throw new InvalidOperationException(message);
}
context.Response.StatusCode = 404;
context.Response.StatusCode = StatusCodes.Status404NotFound;
return Task.CompletedTask;
};