Crystal
Crystal

Reputation: 5

Error when creating c# code identifier expected

I have an error of "Identifier expected" for this code. What is the problem with the code?

private static IEnumerable<FileInfo[]> ReturnFile(DirectoryInfo[], dirList, string fileSearchPattern) 
{
    foreach (DirectoryInfo dir in dirList) 
    {
        yield return dir.GetFiles(fileSearchPattern, SearchOption.TopDirectoryOnly);
    }
} 

Upvotes: 0

Views: 129

Answers (1)

Risto M
Risto M

Reputation: 3009

You have extra ,-mark in you method signature. Try this:

private static IEnumerable<FileInfo[]> ReturnFile(DirectoryInfo[] dirList, string fileSearchPattern)

Upvotes: 1

Related Questions