Exemplo n.º 1
0
        public Status HandleBacklogsShowRequest()
        {
            try
            {
                var(status, backlogs) = _backlogrepo.GetAll();
                if (status is Failure)
                {
                    return(status);
                }

                var displayItems = backlogs.Select(Transform);
                return(new Success <BacklogShowQueryResult>(new BacklogShowQueryResult(displayItems)));
            }
            catch (Exception)
            {
                return(new Failure("Error occured while retrieving backlogs."));
            }
        }
Exemplo n.º 2
0
        public Status HandleBacklogsShowRequest()
        {
            try
            {
                var backlogs     = _backlogrepo.GetAll();
                var displayItems = backlogs.Select(Transform);
                return(new Success <BacklogShowQueryResult>(new BacklogShowQueryResult(displayItems)));
            }
            catch (Exception)
            {
                return(new Failure());
            }

            BacklogShowQueryResult.BacklogDisplayItem Transform(Backlog backlog)
            {
                var submissions = _backlogrepo.ReadSubmissions(backlog.Id);

                return(BacklogShowQueryResult.BacklogDisplayItem.FromBacklog(backlog, submissions));
            }
        }