Multi tasking Ask Question
By   Junaid A     06-Jan-2025    1

Step 1

 private void ParseRss(NewsCategory categoryItem)
{
// get rss link
}


Step 2

    upadate rss using task.wait all

public void PorcessNews()
{

      var newsCategoryList = _storedb.NewsCategories.ToList();

                Task.WaitAll((from product in newsCategoryList
                              select Task.Run(() => ParseRss(product))).ToArray());

              //  PriceMatchLogger.Debug("NewsParser.Parse: News  parsing complete");

                _storedb.SaveChanges();
}
 

Solutions


10334
Copyright Future Minutes © 2015- 2025 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM