public async Task GenerateTasksAsync(GenerateTaskModel generateTaskModel) { var taskGenerationEntity = CreateTaskGenerationEntity(generateTaskModel); taskGenerationEntity = await _taskGenerationRepository.AddAsync(taskGenerationEntity); var parsedSents = await _parsedSentService.GetAllByAnalyzeAndGrammarPartAsync( generateTaskModel.AnalyzeId, generateTaskModel.GrammarPart); var taskGenerator = _taskItemsGeneratorFactory.GetTaskItemsGenerator( generateTaskModel.GrammarPart, generateTaskModel.TaskType); var taskItems = taskGenerator.GenerateTaskItems( taskGenerationEntity.Id, generateTaskModel, parsedSents); await _taskItemService.AddManyAsync(taskItems); }