private FundValueResponse MapFundValue(DataTable dtResult)
        {
            FundValueResponse response = null;

            if (dtResult != null)
            {
                response = (from dr in dtResult.AsEnumerable()
                            select new FundValueResponse()
                {
                    SchemaCode = int.Parse(dr["SchemaCode"].ToString()),
                    Amount = decimal.Parse(dr["Amount"].ToString()),
                    AvgNav = decimal.Parse(dr["avgNav"].ToString()),
                    Date = DateTime.Parse(dr["Date"].ToString()),
                    Dividend = decimal.Parse(dr["Dividend"].ToString()),
                    LatestNav = decimal.Parse(dr["latestNav"].ToString()),
                    LatestValue = decimal.Parse(dr["LatestValue"].ToString()),
                    Units = decimal.Parse(dr["Units"].ToString()),
                }).FirstOrDefault();
            }
            return(response);
        }
Пример #2
0
        public HttpResponseMessage GetFundValue(GetFundValueRequst _getFundValueRequest)
        {
            FundValueResponse response = _mutualFundsRepository.GetFundValue(_getFundValueRequest);

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }