public ActionResult <string> GetShares(int clientId) { try { string shares = string.Empty; foreach (var item in clientService.GetClientSharesById(clientId)) { shares += $"Shares: {item.Key.SharesType} Price: {item.Key.Price} Quantity: {item.Value}{Environment.NewLine}"; } return(shares); } catch (Exception ex) { return(BadRequest(ex.Message)); } }