internal void AddQueryLinkMode(QueryLinkMode mode) { if (_queryType != QueryType.Link) { throw new InvalidOperationException("This method is only used in case of Link query"); } _queryLinkMode = mode; }
public static WorkItemLinkInfo [] QueryLinks( this TfsTeamProjectCollection tpc, Expression <Predicate <WorkItem> > sourcePredicate, Expression <Predicate <WorkItem> > targetPredicate, string linkType, QueryLinkMode mode ) { var qb = new QueryBuilder(QueryType.Link); var sourceLambda = sourcePredicate as LambdaExpression; var targetLambda = targetPredicate as LambdaExpression; var whereSourceTranslator = new WhereClauseTranslator(new WorkItemHelper(), "Source"); var sourceFilter = whereSourceTranslator.Translate(sourceLambda.Body, qb, sourceLambda.Parameters[0].Name); if (!string.IsNullOrEmpty(sourceFilter)) { qb.AddWhereClause(sourceFilter); } var whereTargetTranslator = new WhereClauseTranslator(new WorkItemHelper(), "Target"); var targetFilter = whereTargetTranslator.Translate(sourceLambda.Body, qb, targetLambda.Parameters[0].Name); if (!string.IsNullOrEmpty(targetFilter)) { qb.AddWhereClause(targetFilter); } qb.AddQueryLinkMode(mode); var q = qb.BuildQuery(tpc, null, null); return(q.GetLinks()); }
/// <summary> /// Initializes a new instance of the <see cref="QueryBuilder" /> class. /// </summary> public QueryBuilder(QueryType queryType) { _queryType = queryType; _queryLinkMode = QueryLinkMode.MustContain; }
/// <summary> /// Initializes a new instance of the <see cref="QueryBuilder"/> class. /// </summary> public QueryBuilder(QueryType queryType) { _queryType = queryType; _queryLinkMode = QueryLinkMode.MustContain; }
internal void AddQueryLinkMode(QueryLinkMode mode) { if (_queryType != QueryType.Link) { throw new InvalidOperationException("This method is only used in case of Link query"); } _queryLinkMode = mode; }