public async Task ParseRoles() { logger.Log("Started ParseRoles job."); ICollection <long> seiyuuIdCollection = (await seiyuuRepository.GetAllAsync()).Select(x => x.MalId).ToList(); foreach (long seiyuuMalId in seiyuuIdCollection) { try { var seiyuuRoles = await roleRepository.GetAllAsync(x => x.SeiyuuId.Equals(seiyuuMalId)); Person seiyuuFullData = await SendSinglePersonRequest(seiyuuMalId, 0); logger.Log($"Parsing seiyuu with id {seiyuuMalId}"); foreach (VoiceActingRole role in seiyuuFullData.VoiceActingRoles) { await InsertRole(seiyuuMalId, role, seiyuuRoles); } } catch (Exception ex) { logger.Log($"Error during parsing seiyuu with id {seiyuuMalId}: {ex.Message}"); continue; } } logger.Log("Finished ParseRoles job."); }