I have 2 Linq Queries, 1st Linq Query returns 1148 records and 2nd returns 6667 records. They take 8 minutes in execution. Is there any way to make them faster while running parallel?
var productbacklogworkitem =
(from w in workItemcollectionList where w.Type.Name == "Product Backlog Item" select new {
Id = w.Id,
Name = w.Title,
FID = (w.WorkItemLinks.Count > 0) ? ((w.WorkItemLinks[0].LinkTypeEnd.Name.ToString() != "Child") ? w.WorkItemLinks[0].TargetId : 0) : 0,
Type = w.Type.Name,
State =w.State,
priorty = Convert.ToInt32(w.Fields["Priority"].Value),
Size = Convert.ToInt32(w.Fields["Effort"].Value),
StoryPoints = Convert.ToInt32(w.Fields["Story Points"].Value),
DoneStatus = w.Fields["Done Status"].Value.ToString(),
StoryOwner = w.Fields["Story Owner"].Value.ToString(),
Assignedto = w.Fields["Assigned To"].Value.ToString(),
StoryAuthor = w.Fields["Story Author"].Value.ToString(),
IterationPath = w.IterationPath
}).ToList();
var taskbugsworkitem =
(from w in workItemcollectionList where (w.Type.Name == "Task" || w.Type.Name == "Bug") && (w.WorkItemLinks.Count > 0) select new {
Id = w.Id,
Name = w.Title,
Type = w.Type.Name,
Storyid = w.WorkItemLinks[0].TargetId,
status = w.State,
IterationPath = w.IterationPath,
Assignedto = w.Fields["Assigned To"].Value.ToString(),
priorty = Convert.ToInt32(w.Fields["Priority"].Value),
effort = Convert.ToInt32(w.Fields["effort"].Value),
Completed = (w.Type.Name== "Task") ? Convert.ToInt32(w.Fields["Completed"].Value):0
}) .ToList();