MVC, C# - Not All Code Paths Return A Value : <p>I'm creating a basic MVC Copy File App and am returning a Not All Code Paths Return a Value error in my GetSource method. I've researched the issue and have tried a few things, but the error still generates. I believe the error is in the foreach loop somewhere, but I tried returning a null afterwards, which just threw up a different error. Any help is appreciated as I am a beginner. Thanks!</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;


namespace April24
{
    public class Andrew
    {
        public string Copy()
        {
            return "Done Copying";
        }
        public string GetSource() //Error is here
        {
            copyFiles(10);
        }
        public static string production = @"C:\Users\test\Desktop\Production";
        public static string renameFolder = @"C:\Users\test\Desktop\RenameFolder\";

        static private void copyFiles(int numberOfFiles)
        {
            List&lt;string&gt; files = System.IO.Directory.GetFiles(production, "*").ToList();
            IEnumerable&lt;string&gt; filesToCopy = files.Where(file =&gt; file.Contains("Test_Name")).Take(10);

            foreach (string file in filesToCopy)
            {

                string destfile = renameFolder + System.IO.Path.GetFileName(file);

                System.IO.File.Copy(file, destfile, true);
            };
            /*tried return null; here but still threw error*/

        }
    }
}
</code></pre>
