public void ShareShateathons()
        {
            DatabaseRepository dbr = new DatabaseRepository();
            MongoRepository    _ShareathonRepository = new MongoRepository("Shareathon");
            var result = _ShareathonRepository.FindAll <Domain.Socioboard.Models.Mongo.PageShareathon>();
            var task   = Task.Run(async() =>
            {
                return(await result);
            });
            IList <Domain.Socioboard.Models.Mongo.PageShareathon> lstPageShareathon = task.Result.ToList();

            ThreadPool.SetMaxThreads(10, 5);
            noOfthread_pageshreathonRunning = 0;
            foreach (PageShareathon shareathon in lstPageShareathon.ToList())
            {
                try
                {
                    noOfthread_pageshreathonRunning++;
                    Thread thread_pageshreathon = new Thread(() => pageshreathon(new object[] { shareathon, dbr, _ShareathonRepository }));
                    thread_pageshreathon.Start();
                    while (noOfthread_pageshreathonRunning > 5)
                    {
                        Thread.Sleep(1 * 1000);
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Ejemplo n.º 2
0
 public IActionResult GetAlbums()
 {
     try
     {
         _logger?.LogInformation("Fetching albums from repo.");
         var results = mongoRepo.FindAll <Album>(collectionName);
         return(Ok(new { total = results?.Count, results = results }));
     }
     catch (Exception e)
     {
         return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
     }
 }
Ejemplo n.º 3
0
        public IActionResult GetCategories()
        {
            MongoRepository mongoreppo = new MongoRepository("GroupPostKeyWords", _appSettings);
            var             result     = mongoreppo.FindAll <Domain.Socioboard.Models.Mongo.GroupPostKeyWords>();
            var             task       = Task.Run(async() =>
            {
                return(await result);
            });
            IList <Domain.Socioboard.Models.Mongo.GroupPostKeyWords> lstFbFeeds = task.Result;
            List <Domain.Socioboard.Models.Mongo.GroupPostKeyWords>  grppost    = lstFbFeeds.ToList().OrderByDescending(t => t.createdTime).Take(15).ToList();

            return(Ok(grppost));
        }
Ejemplo n.º 4
0
 public IEnumerable <InventoryItemListDto> GetInventoryItems()
 {
     return(_repository.FindAll <InventoryItemListDto>());
 }