示例#1
0
        public Task <NetWorth> calculateNetWorthAsync(PortFolioDetails portFolioDetails)
        {
            _log4net.Info("Provider called from Controller to calculate the networth");
            var networth = _netWorthRepository.calculateNetWorthAsync(portFolioDetails);

            if (networth.Result.Networth == 0)
            {
                return(null);
            }
            return(networth);
        }
示例#2
0
        /// <summary>
        /// Calculating the networth of user with given portfolio details
        /// </summary>
        /// <param name="portFolioDetails"></param>
        /// <returns></returns>
        public Task <NetWorth> calculateNetWorthAsync(PortFolioDetails portFolioDetails)
        {
            NetWorth networth = new NetWorth();

            try
            {
                _log4net.Info("Provider called from Controller to calculate the networth");
                if (portFolioDetails.PortFolioId == 0)
                {
                    return(null);
                }
                networth = _netWorthRepository.calculateNetWorthAsync(portFolioDetails).Result;
            }
            catch (Exception ex)
            {
                _log4net.Error("Exception occured while calculating the networth" + ex.Message);
            }
            return(Task.FromResult(networth));
        }