Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update IWeatherService to include methods for adding weather f… #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vtjc2002
Copy link
Owner

@vtjc2002 vtjc2002 commented Dec 12, 2024

This pull request introduces several new features and improvements to the Weather API project. The main changes include the addition of new methods for handling weather forecasts, enhancements to the IWeatherService interface, and improvements to the UnsafeService to prevent security vulnerabilities.

New Features and Methods:

  • WeatherForecastsControllerTests.cs: Added three new test methods: GetWeatherForecastFound, AddWeatherForecastSuccess, and AddWeatherForecastFailure to test different scenarios for getting and adding weather forecasts.
  • WeatherForecastsController.cs: Introduced the AddWeatherForecast method to handle POST requests for adding new weather forecasts. This method includes error handling and response type annotations.

Enhancements to IWeatherService Interface:

  • IWeatherService.cs: Added method signatures for GetWeatherForecastsAsync, GetWeatherForecastAsync, and AddWeatherForecastAsync with detailed documentation comments.

Security Improvements:

  • UnsafeService.cs: Enhanced the ReadFile method to validate user input and prevent path traversal attacks. Introduced a parameterized query in the GetProduct method to prevent SQL injection. [1] [2]

Additional Changes:

  • WeatherService.cs: Added methods GetWeatherForecastAsync, GetWeatherForecastsAsync, and AddWeatherForecastAsync with documentation comments and error handling. [1] [2]

…orecasts

- add controller method to add weather forecast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant