// 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; }
public Crawler() { _monsterCrawler = new MonsterCrawler(); _itemCrawler = new ItemCrawler(); }