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.")); } }
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)); } }