コード例 #1
0
        Project GetProject(ListSprintsRequest request)
        {
            if (request.Project != null)
            {
                return(data.Theorise(request.Project));
            }

            return(currentProjectProvider.GetCurrentProject());
        }
コード例 #2
0
        public IList <Sprint> GetSprints(ListSprintsRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            return(data.Query <Sprint>()
                   .Where(GetSpecification(request))
                   .OrderBy(x => x.StartDate.HasValue ? x.StartDate : x.CreationDate)
                   .ToList());
        }
コード例 #3
0
        // If this method needs to become any more complex, then break it away to a service of its own which gets
        // a spec from a request.
        ISpecificationExpression <Sprint> GetSpecification(ListSprintsRequest request)
        {
            var project = GetProject(request);
            ISpecificationExpression <Sprint> spec = projectSprintFactory(project);

            if (!request.ShowOpenSprints)
            {
                spec = spec.And(closedSprintFactory());
            }

            if (!request.ShowClosedSprints)
            {
                spec = spec.And(openSprintFactory());
            }

            return(spec);
        }