Example #1
0
 // GET api/values
 public async System.Threading.Tasks.Task<bool> UpdateAtlanticaMonster()
 {
     
     try
     { 
         List<Monster> monsters = await MonsterCrawler.ReadMonsters();
         IList<Monster> currentmonsters = _monsterService.GetAll();
         for (int i = 0; i < monsters.Count; i++)
         {
             Monster auxmonster = monsters[i];
             if(currentmonsters.Count(c=>c.Id == auxmonster.Id) <= 0)
                 _monsterService.Create(auxmonster);
         }
     }
     catch (Exception ex)
     {
         return false;
     }
     return true;
 }
Example #2
0
 public Crawler()
 {
     _monsterCrawler = new MonsterCrawler();
     _itemCrawler    = new ItemCrawler();
 }