public bool Equals(EscortItemModel b) { foreach (KeyValuePair <string, object> field in this.tfsObj.Fields) { var objA = tfsObj.Fields[field.Key]; var objB = b.tfsObj.Fields[field.Key]; if (!objA.Equals(objB)) { return(false); } } return(true); }
public Dictionary <string, EscortItemModel> Extract(DateTime atime) { Wiql wiql = new Wiql() { Query = string.Format(@"SELECT * FROM WorkItems WHERE [Team Project] = 'Mooncake' AND [Work Item Type] = 'Escort Request' AND [Created Date] >='{0}'", atime) }; using (WorkItemTrackingHttpClient workItemTrackingHttpClient = new WorkItemTrackingHttpClient(this.uri, this.vssBasic)) { //execute the query to get the list of work items in the results WorkItemQueryResult workItemQueryResult = workItemTrackingHttpClient.QueryByWiqlAsync(wiql).Result; //create a dic to hold process result Dictionary <String, EscortItemModel> results = new Dictionary <string, EscortItemModel>(); workItemQueryResult.AsOf = DateTime.Now; if (workItemQueryResult.WorkItems.Count() != 0) //get fileds if query result is not empty { //need to get the list of our work item ids and put them into an array List <int> list = new List <int>(); foreach (var item in workItemQueryResult.WorkItems) { list.Add(item.Id); } int[] arr = list.ToArray(); //build a list of the fields we want to see string[] fields = createFieldMapper(); //execute var workItems = workItemTrackingHttpClient.GetWorkItemsAsync(arr, fields, workItemQueryResult.AsOf).Result; //Console.WriteLine("Query Results: {0} items found", tickets.Count); //process query data and holdem with object foreach (var workItem in workItems) { EscortItemModel item = new EscortItemModel(workItem); item.tfsObj = workItem; results.Add(item.iD, item); } } return(results); } }