title: How to get a specific file from directory in C#
body: <p>Using <code>Directory.GetFiles()</code> returns all the files in the directory as follows:</p>
  
  <pre><code>var sqlFiles = Directory.GetFiles($"{AppDomain.CurrentDomain.BaseDirectory}Content\\DbScripts\\","*.sql");
  </code></pre>
  
  <p>Actually I need a specific file from that directory. What I have tried so far as follows but don't work!</p>
  
  <pre><code>var localizationSqlFile = Directory.GetFiles($"{AppDomain.CurrentDomain.BaseDirectory}Content\\DbScripts\\Localizations.sql").FirstOrDefault();
  </code></pre>
  
  <p>It throws expection:</p>
  
  <blockquote>
    <p>The directory name is invalid.\r\n</p>
  </blockquote>
  
  <p>Is there any method in C# to get a single file from a directory? If not then what will be most efficient way?</p>