Esempio n. 1
0
        public Sprint GetNextSprint(int projectId)
        {
            var project = _projectDAO.GetProjectById(projectId);

            if (project.Sprints.Count == 0)
            {
                var sprint = new Sprint()
                {
                    Order = 0,
                    State = SprintState.QUEUING,
                };
                _projectDAO.AddSprint(projectId, sprint);
                _projectDAO.SetStartDate(projectId, DateTime.Today);
                project = _projectDAO.GetProjectById(projectId);
            }

            return(project.Sprints.OrderByDescending(sprint => sprint.Order).First());
        }