public WorkItemTreeViewModel(WorkItem workItem) : base(workItem) { if (workItem.ParentId.HasValue) { Parent = new WorkItemTreeParentViewModel(workItem.Parent); } Children.AddRange(workItem.Children.Select(x => new WorkItemTreeViewModel(x))); Creater = new UserInfoViewModel(workItem.Creator); }
public WorkItemTreeParentViewModel(WorkItem workItem) { Id = workItem.Id; Name = workItem.Name; if (workItem.ParentId.HasValue) { Parent = new WorkItemTreeParentViewModel(workItem.Parent); } }