I am involved in the LINQ learning process and would like to help in the following method. How to rewrite the following method to use LINQ?
private bool IsInList(string file, List<FileInfo> excelList)
{
if (excelList != null && excelList.Count > 0)
{
foreach (FileInfo f in excelList)
{
if (string.Compare(f.FullName, file, StringComparison.OrdinalIgnoreCase) == 0)
{
return true;
}
}
}
return false;
}
source
share