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); }