public IActionResult getGplusfeeds(long boardId, string skip, string count) { DatabaseRepository dbr = new DatabaseRepository(_logger, _env); Domain.Socioboard.Models.MongoBoards board = BoardMeRepository.getBoard(boardId, _redisCache, _appSettings, _logger, dbr); MongoRepository boardrepo = new MongoRepository("MongoBoardGplusFeeds", _appSettings); try { //List<MongoBoardGplusFeeds> objBoardGplusPagefeeds = boardrepo.getBoardGplusfeedsbyrange(Guid.Parse(BoardGplusprofileId), Convert.ToInt32(_noOfDataToSkip), Convert.ToInt32(_noOfResultsFromTop)); var builder = Builders <MongoBoardGplusFeeds> .Sort; var sort = builder.Descending(t => t.Publishedtime); //var result = boardrepo.FindWithRange<MongoBoardGplusFeeds>(t => t.Gplusboardaccprofileid.Equals(board.gplusHashTag),sort,Convert.ToInt32(skip),Convert.ToInt32(count)).ConfigureAwait(false); var result = boardrepo.BoardFind <MongoBoardGplusFeeds>(t => t.Gplusboardaccprofileid.Equals(board.gplusHashTag)).ConfigureAwait(false); var task = Task.Run(async() => { return(await result); }); IList <MongoBoardGplusFeeds> objTwitterPagelist = task.Result; List <MongoBoardGplusFeeds> 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(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("MongoBoardInstagramFeeds", _appSettings); try { var builder = Builders <MongoBoardInstagramFeeds> .Sort; var sort = builder.Descending(t => t.Publishedtime); //var result = boardrepo.FindWithRange<MongoBoardInstagramFeeds>(t => t.Instagramaccountid.Equals(board.instagramHashTag),sort,skip, count).ConfigureAwait(false); var result = boardrepo.BoardFind <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")); } }