Using TFS SDK, I am querying workitems using WorkItemStore.Query
:
WorkItemCollection workItems = WorkItemStore.Query("SELECT ID from workitems");
foreach(WorkItem wi in workItems)
{
string Id = wi.Id;
foreach(Attachment attachment in wi.Attachments)
{
Console.Write(attachment.Uri.OriginalString); //SLOW
}
}
Accessing items from the collection is too slow. Is it talking to the TFS server everytime I access a WorkItem member? Is there a way to construct my query in such a way that it will get all the fields that I need in one go?
Problem is, the TFS server is located off-shore, and that's why it's slow. Querying stuff en-masse makes it a lot faster.
EDIT: I can't query the attachments field. "attachments" is not a valid field.