public ActionResult <Dictionary <string, string> > GetDivFreqAndMonths(string ticker) { ProfileProcessing profileBusLogicComponent = new ProfileProcessing(); Dictionary <string, string> divSpecs = profileBusLogicComponent.CalculateDivFreqAndDivMonths(ticker, _dbCtx); return(Ok(divSpecs)); }
public ActionResult <Profile> GetProfile(string tickerProfileToFetch) { ProfileProcessing profileBusLogicComponent = new ProfileProcessing(); var profileModel = new Profile { TickerSymbol = tickerProfileToFetch }; Dictionary <string, string> dividendFreqAndMonths = profileBusLogicComponent.CalculateDivFreqAndDivMonths(profileModel.TickerSymbol, _dbCtx); if (dividendFreqAndMonths != null) { profileModel.DividendFreq = dividendFreqAndMonths["DF"]; if (!string.IsNullOrEmpty(dividendFreqAndMonths["DPD"])) { profileModel.DividendPayDay = Convert.ToInt32(dividendFreqAndMonths["DPD"]); } Profile initializedProfile = profileBusLogicComponent.BuildProfileForProjections(profileModel, _dbCtx); return(Ok(initializedProfile)); } else { return(BadRequest(new { warningMsg = "No web Profile data found." })); // status: 400. } }