public async ValueTask <(Sprint, IEnumerable <SprintStory>)> CreatePlan(ServiceContext context) { IEnumerable <Status> statuses = await _statusRepository.ListAllAsync(context); Sprint sprint = await _sprintRepository.AddAsync(context, GetNewSprint(context, statuses)); SprintStoryBuilder builder = new SprintStoryBuilder(); SprintStoryDirector director = new SprintStoryDirector(builder); Collection <SprintStory> sprintStories = new Collection <SprintStory>(); director.Construct(null, sprint.Statuses, sprint.Issues); sprintStories.Add(builder.GetResult()); return(sprint, sprintStories); }
public async ValueTask <IEnumerable <SprintStory> > GetSprintStories(ServiceContext context, int sprintId) { Sprint sprint = await _sprintRepository.GetByIdAsync(context, sprintId); SprintStoryBuilder builder = new SprintStoryBuilder(); SprintStoryDirector director = new SprintStoryDirector(builder); Collection <SprintStory> sprintStories = new Collection <SprintStory>(); foreach (Story story in sprint.Stories) { director.Construct(story, sprint.Statuses, story.Issues); sprintStories.Add(builder.GetResult()); } return(sprintStories); }