コード例 #1
0
        public ActionResult <double> CalculateNetworth(int portfolioId)
        {
            if (portfolioId < 0)
            {
                return(this.BadRequest("Incorect ID"));
            }

            PortfolioDetails portfolioDetails = _PortfolioService.GetPortfolio(portfolioId);

            if (portfolioDetails == null)
            {
                return(this.BadRequest("Empty Portfolio"));
            }

            double result = _PortfolioService.CalculateNetworth(portfolioDetails).Result;

            return(result);
        }