/// <summary>
        /// Initializes a new instance of the <see cref="WorkItemLazyVisitor"/> class.Lazily loads workitem(s) based on query.</summary>
        /// <exception cref="ArgumentOutOfRangeException">When Query.Levels &lt; 1.</exception>
        public WorkItemLazyVisitor(IWorkItem sourceWorkItem, FluentQuery query)
        {
            if (query.Levels < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(query.Levels), "levels must be 1 or greater");
            }

            // source info
            this.sourceWorkItem = sourceWorkItem;

            // target filter
            this.workItemType = query.WorkItemType;
            this.levels       = query.Levels;
            this.linkType     = query.LinkType;
        }
 public static WorkItemLazyVisitor MakeRelativesLazyVisitor(IWorkItem sourceItem, FluentQuery query)
 {
     return(new WorkItemLazyVisitor(sourceItem, query));
 }
 protected bool Equals(FluentQuery other)
 {
     return(string.Equals(this.WorkItemType, other.WorkItemType) && this.Levels == other.Levels && string.Equals(this.LinkType, other.LinkType));
 }