public IActionResult getfacebookFeeds(long boardId, int skip, int count) { DatabaseRepository dbr = new DatabaseRepository(_logger, _env); Domain.Socioboard.Models.MongoBoards board = BoardMeRepository.getBoard(boardId, _redisCache, _appSettings, _logger, dbr); MongoRepository boardrepo = new MongoRepository("MongoBoardFbTrendingFeeds", _appSettings); try { var result = boardrepo.Find <MongoBoardFbTrendingFeeds>(t => t.facebookprofileid.Equals(board.facebookHashTag)); var task = Task.Run(async() => { return(await result); }); IList <MongoBoardFbTrendingFeeds> objTwitterPagelist = task.Result; List <MongoBoardFbTrendingFeeds> objBoardGplusPagefeeds = objTwitterPagelist.OrderByDescending(t => t.publishedtime).Skip(Convert.ToInt32(skip)).Take(Convert.ToInt32(count)).ToList(); return(Ok(objBoardGplusPagefeeds)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return(Ok("Something Went Wrong")); } }
public IActionResult getInstagramFeeds(string boardId, int skip, int count) { MongoBoards board = BoardMeRepository.getBoard(boardId, _redisCache, _appSettings, _logger); MongoRepository boardrepo = new MongoRepository("MongoBoardInstagramFeeds", _appSettings); try { var result = boardrepo.Find <MongoBoardInstagramFeeds>(t => t.Instagramaccountid.Equals(board.instagramHashTag)).ConfigureAwait(false); var task = Task.Run(async() => { return(await result); }); IList <MongoBoardInstagramFeeds> objTwitterPagelist = task.Result; List <MongoBoardInstagramFeeds> objBoardGplusPagefeeds = objTwitterPagelist.OrderByDescending(t => t.Publishedtime).Skip(Convert.ToInt32(skip)).Take(Convert.ToInt32(count)).ToList(); return(Ok(objBoardGplusPagefeeds)); } catch (Exception ex) { _logger.LogError(ex.StackTrace); return(Ok("Something Went Wrong")); } }