/// <summary>
        /// Converts the specified status.
        /// </summary>
        /// <param name="status">The status.</param>
        /// <returns>
        /// The summary.
        /// </returns>
        private static TaskSummary Convert(ItemStatus status)
        {
            var model = new TaskSummary
            {
                Description = status.Description,
                Name        = status.Name,
                Tasks       = status.ChildItems.Any() ? status.ToModel() : null,
                Status      = Convert(status.Status),
                Error       = status.Error
            };

            if (status.TimeStarted.HasValue || status.TimeCompleted.HasValue)
            {
                model.Times = new TaskSummaryTimes
                {
                    Started   = status.TimeStarted,
                    Completed = status.TimeCompleted
                };
            }

            return(model);
        }
Exemplo n.º 2
0
        public IEnumerable <Item> FindByStatus(ItemStatus status)
        {
            var itemsModel = _itemService.FindByStatus(status.ToModel());

            return(itemsModel.Select(item => item.ToViewModel()));
        }