 <p>I solved it with <a href="http://msdn.microsoft.com/en-us/library/bb126445.aspx" rel="nofollow">T4</a>. Now I have <code>Queries</code> directory in my project and <code>SQLGenerator.tt</code> in it. Here is my template source code:</p> <pre><code>&lt;#@ template debug="true" hostSpecific="true" #&gt; &lt;#@ output extension=".cs" #&gt; &lt;#@ Assembly Name="System.Core" #&gt; &lt;#@ Assembly Name="System.Windows.Forms" #&gt; &lt;#@ import namespace="System" #&gt; &lt;#@ import namespace="System.IO" #&gt; &lt;#@ import namespace="System.Diagnostics" #&gt; &lt;#@ import namespace="System.Linq" #&gt; &lt;#@ import namespace="System.Collections" #&gt; &lt;#@ import namespace="System.Collections.Generic" #&gt; &lt;#var sqlScriptsContent = ReadSql(); #&gt; namespace MathApplication.SQL { public class Queries { &lt;# foreach(var file in sqlScriptsContent) { #&gt; public string &lt;#= file.Key #&gt; = @"&lt;#= file.Value #&gt;"; &lt;# } #&gt; } } &lt;#+ public Dictionary&lt;string, string&gt; ReadSql() { var filePaths = Directory.GetFiles(Host.ResolvePath(".")); var result = new Dictionary&lt;string, string&gt;(); foreach (var filename in filePaths) { if (filename.EndsWith(".sql")) { result[Path.GetFileNameWithoutExtension(filename)] = System.Text.RegularExpressions.Regex.Replace(File.ReadAllText(filename), @"\s+", " ").Replace("\"", "'"); } } return result; } #&gt; </code></pre> <p>This code assembles all <code>*.sql</code> files in <code>Queries</code> directory to one class.</p>