public static List <FundAssetConfig> GetFundAssetConfigs(string fundCode) { var configs = DataDao.GetFundAssetConfigs(fundCode); if (DataHelper.IsDataReady(configs?.LastOrDefault())) { return(configs); } else { configs = EmService.GetFundAssetConfigs(fundCode); DataDao.UpdateFundAssetConfigs(configs); return(configs); } }
public static async Task <List <FundStockPosition> > GetFundStockPositions(string fundCode, DateTime date) { var positions = DataDao.GetFundStockPositions(fundCode, date); if (DataHelper.IsDataReady(positions?.FirstOrDefault())) { return(positions); } else { positions = await EmService.GetFundStockPositions(fundCode, date); DataDao.UpdateFundStockPositions(positions); return(positions); } }
public static async Task <List <FundScale> > GetFundScales(string fundCode) { var scales = DataDao.GetFundScales(fundCode); if (DataHelper.IsDataReady(scales?.LastOrDefault())) { return(scales); } else { scales = await EmService.GetFundScales(fundCode); DataDao.UpdateFundScales(scales); return(scales); } }
public static async Task <List <FundNav> > GetFundNavs(string fundCode) { var navs = DataDao.GetFundNavs(fundCode); if (DataHelper.IsDataReady(navs?.LastOrDefault())) { return(navs); } else { navs = await EmService.GetFundNavs(fundCode); DataDao.UpdateFundNavs(navs); return(navs); } }
public static FundInfo GetFundInfo(string fundCode) { var info = DataDao.GetFundInfo(fundCode); if (DataHelper.IsDataReady(info)) { return(info); } else { var noData = info == null; info = EmService.GetFundInfo(fundCode); if (noData) { DataDao.InsertFundInfo(info); } else { DataDao.UpdateFundInfo(info); } return(info); } }