C# how to populate a string, IList, or Array through if statement
<p>I have the following code:</p>

<pre><code>foreach (string file in FleName)
            if (!ActualFiles.Any(x =&gt; Path.GetFileName(x).Equals(file)))
            {                   
                  IList&lt;string&gt; MissingFiles = file;
            }  
</code></pre>

<p>I have 3 if statements that access this method. At the end of the if statements I need to show the entire IList. </p>

<p>So heres what I want. First if statment goes into the method and returns every file with the word "EqpFle -" before each value</p>

<p>The second if statemenet I want it to return all those items with "DPFle-" in front of all the names, and simialr for the third.</p>

<p>At the end of all the if statements (this is in a for each) I want it to read the entire list.</p>

<p>how owuld I do this?</p>

<p>the ifs basically look as follows:</p>

<pre><code>    foreach (string file in files)
    {
    if
    {
    Check &lt;----thats the method
    }
    if
    {
    Check &lt;----thats the method
    }
    if
    {
    Check &lt;----thats the method
    }
    }
</code></pre>
