private async Task <bool[]> PopulateJournalAsync(bool randomExecute = false, int randomChanceCount = 3, int randomPoolSize = 10) { var journal = new Activity(); var numberOfCycles = 1; List <Task <bool> > tasks = new List <Task <bool> >(); int bet = 0; if (randomExecute) { bet = (new Random()).Next(randomPoolSize); } for (int i = 0; i < numberOfCycles; i++) { foreach (var typeId in _SubjectTypeIds) { foreach (var subjectId in _SubjectIds) { if ((!randomExecute) || RandomAllow(bet, randomChanceCount, randomPoolSize)) { var partitionKey = $"{subjectId}-{typeId}"; tasks.Add(journal.AddAsync(subjectId, typeId, RandomSelect(new string[] { "1", "2", "3" }), RandomSelect(_ValueTypes), RandomSelect(_Actors))); } } } } return(await Task.WhenAll(tasks)); }