I have a web service that has a logical data set. When I use LINQ to be able to obtain a parameter that I want, I do it without problems.
Where I find problems is when I call a second web service and I have to make a condition IF
to only get certain results based on the status of the project.
How can I integrate the result of the data set with the filter in the IF
I have before proceeding with my execution?
This is what I have in the data set web service call:
foreach (WS.ProjectMetaData proj in pr.Distinct(new ProjectEqualityComparer()))
{
string languages = "";
string projectId = proj.ProjectID.ToString();
//calling GetProjectDetails()
var projectType = client.GetProjectDetails(ref apiKey, ref message, languages);
var type = projectType.Tables["Table"].Select("ProjectId = '" + projectId + "'").
Where(s => s.Field<string>("DefinitionType") != "survey").FirstOrDefault();
}
The part above the code works well for me, because it only gives me the projects that do not have the definition of type "survey"
In the next part of the code I have my condition IF
where I also need to filter the projects. So what I'm looking for is that the projects are not expired
, Not Published
and that do not have as definition survey
Here is how I call the condition:
if (proj.PublishStatus != "expired" && proj.PublishStatus != "Not Published")