Пример #1
0
        public async Task <IActionResult> GetAveragePrice(
            [FromQuery, MinLength(1)] string portfolio,
            [FromQuery, MinLength(1)] string owner,
            [FromQuery, MinLength(1)] string instrument,
            [FromQuery, Required] DateTime date)
        {
            var result = await _priceCalculationService.CalculateAveragePrice(date, portfolio, owner, instrument);

            if (result != null)
            {
                return(Ok(new AveragePriceResponse
                {
                    Date = result.Date,
                    Price = result.Price
                }));
            }

            return(NotFound());
        }