CSR-Pattern-Example/API/Controllers/WeatherForecastController.cs
/// <summary>
/// Gets the weather forecast for a given date.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Gets the weather forecast for a given date.
Gets the weather forecast for a given date .
[HttpGet]
        [Route("forecast")]
        [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeatherForecastApiResponse))]
        public IActionResult GetForecast([FromQuery] GetForecastApiRequest request)
        {
            _logger.LogInformation($"weather/forecast API method called at {DateTime.UtcNow} (UTC).");
            var forecast = _weatherService.GetForecast(request.Date);
            return Ok(forecast.ToApiModel());
        }
[ HttpGet ] [ Route ( " " ) ] [ ProducesResponseType ( StatusCodes . Status200OK , Type = typeof ( WeatherForecastApiResponse ) ) ] public IActionResult GetForecast ( [ FromQuery ] GetForecastApiRequest request ) { _logger . LogInformation ( $" weather/forecast API method called at  { DateTime . UtcNow }  (UTC). " ) ; var forecast = _weatherService . GetForecast ( request . Date ) ; return Ok ( forecast . ToApiModel ( ) ) ; }
Gets the weather forecast for a given date.
Gets the weather forecast for a given date .
None
GetForecastApiRequest
[FromQuery]
request
None