示例#1
0
        public AssetSaleResponse sellAssets(List <PortFolioDetails> listOfAssetsCurrentlyHoldingAndAssetsToSell)
        {
            _log4net.Info("Provider called from Controller to sell some assets");
            AssetSaleResponse assetSaleResponse = _netWorthRepository.sellAssets(listOfAssetsCurrentlyHoldingAndAssetsToSell);

            if (assetSaleResponse == null)
            {
                return(null);
            }
            return(assetSaleResponse);
        }
示例#2
0
        /// <summary>
        /// Selling the assets of the user. The lsit contains two portfolios ofthe same person. In the first, we have his
        /// current portfolio and in the other, we have the portfolio he wants to sell.
        /// </summary>
        /// <param name="listOfAssetsCurrentlyHoldingAndAssetsToSell"></param>
        /// <returns></returns>

        public AssetSaleResponse sellAssets(List <PortFolioDetails> listOfAssetsCurrentlyHoldingAndAssetsToSell)
        {
            AssetSaleResponse assetSaleResponse = new AssetSaleResponse();

            try
            {
                if (listOfAssetsCurrentlyHoldingAndAssetsToSell.Any() == false)
                {
                    return(null);
                }
                _log4net.Info(nameof(sellAssets) + " method called to sell assets of user with id = " + listOfAssetsCurrentlyHoldingAndAssetsToSell[0].PortFolioId);
                assetSaleResponse = _netWorthRepository.sellAssets(listOfAssetsCurrentlyHoldingAndAssetsToSell);
            }
            catch (Exception ex)
            {
                _log4net.Error("Exception occured while selling the assets:" + ex.Message);
            }
            return(assetSaleResponse);
        }