8

I am new to C# (coming from Java) and am trying to write a report that counts the number of code reviews done.

I have no trouble iterating through the code review requests. When a code review is associated with a changeset, I use the following code which works fine:

Changeset changeset = versionControlServer.GetChangeSet(int.Parse(
    workItem.Fields["Associated Context"].Value.ToString()), true, true);

I am trying to do the equivalent with Shelvesets.

I am able to iterate through all the Shelvesets using the following code:

foreach (Shelveset shelveset in versionControlServer.QueryShelvesets(null,null) {
    Console.WriteLine(shelveset.Name);
}

Unfortunately, when I try to do the same command based on the name previously printed out, I get nothing returned. The following code returns an empty list.

foreach (Shelveset shelveset in versionControlServer.QueryShelvesets("ShelvesetName",null)) 
{
    Console.WriteLine(shelveset.Name);
}

Could someone help me to understand what I need to change so that versionControlServer.QueryShelvesets("ShelvesetName",null) returns the shelveset with the name that matches the Associated Context of the CodeReviewRequest work item?

riQQ
  • 9,878
  • 7
  • 49
  • 66
Larry Freeman
  • 418
  • 6
  • 19

0 Answers0