Replies: 1 comment
-
I think that was intentional. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The API template WeatherForecast has the logger injected to the controller and stored in a field, however the logger is unused.
I don't think the template should be encouraging a bad practice of unused parameters/fields.
I understand the need to show how to provide a logger and that the example is too simple to add meaningful logging, so not sure what would be the best way to improve this.
Adding a log line that the GET method has been called feels bad practice as well, as that is already handled by the diagnostic logging.
https://github.com/dotnet/aspnetcore/blob/master/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs#L107
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions