public IActionResult getBoardFeedsByName(string boardName)
        {
            boardName = boardName.Replace("SB", "/");
            boardName = boardName.Replace("____", "\\");
            try
            {
                DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
                List <Domain.Socioboard.Models.MongoBoards> lstboard = dbr.Find <Domain.Socioboard.Models.MongoBoards>(t => t.TempboardName == boardName).ToList();
                if (lstboard.Count > 1)
                {
                    foreach (Domain.Socioboard.Models.MongoBoards brd in lstboard)
                    {
                        if (brd.facebookHashTag != null)
                        {
                            return(Ok(BoardMeRepository.getBoardFeedsByName(brd.boardId, _redisCache, _appSettings, _logger, dbr)));
                        }
                    }
                    return(Ok());
                }
                else if (lstboard.Count == 1)
                {
                    return(Ok(BoardMeRepository.getBoardByName(lstboard.First().boardName, _redisCache, _appSettings, _logger, dbr)));
                }
                else
                {
                    return(Ok());
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return(BadRequest("Something Went Wrong"));
            }

            //try
            //{
            //    Domain.Socioboard.Models.MongoBoards board = dbr.Single<Domain.Socioboard.Models.MongoBoards>(t => t.TempboardName == boardName);
            //    if(board!=null)
            //    {
            //        return Ok(BoardMeRepository.getBoardByName(board.boardName, _redisCache, _appSettings, _logger, dbr));
            //    }
            //    else
            //    {
            //        return Ok();
            //    }

            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return BadRequest("Something Went Wrong");
            //}
        }
示例#2
0
 public IActionResult getBoardByName(string boardName)
 {
     try
     {
         return(Ok(BoardMeRepository.getBoardByName(boardName, _redisCache, _appSettings, _logger)));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(BadRequest("Something Went Wrong"));
     }
 }
示例#3
0
        public IActionResult getBoardByName(string boardName)
        {
            boardName = boardName.Replace("SB", "/");
            DatabaseRepository dbr = new DatabaseRepository(_logger, _env);

            try
            {
                return(Ok(BoardMeRepository.getBoardByName(boardName, _redisCache, _appSettings, _logger, dbr)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return(BadRequest("Something Went Wrong"));
            }
        }