Hi @One07k-4914 ,
The following code filters Branches that match all of the corresponding properties of List<includeChanges>.
If I misunderstand your question, please point it out.
private static object GetBranch(List<FileChanges> file, List<Branches> branches) {
return branches.Where(x => x.test1(file)).ToList();
}
public class Branches {
public int Id { get; set; }
public string LocalItem { get; set; }
public string ServerItem { get; set; }
public bool test1(List<FileChanges> fc) {
bool res = true;
foreach (FileChanges fileChanges in fc) {
if (!fileChanges.LocalFilePath.Contains(LocalItem) || !fileChanges.ServerFilePath.Contains(ServerItem)) {
res = false;
break;
}
}
return res;
}
}
Best Regards.
Jiachen Li
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.