string ReadScript(string @namespace, string name)
{
string resourceName = $"{@namespace}.{name}.sql";
using (var str = ass.GetManifestResourceStream(resourceName))
{
if (str == null)
{
string availableResources = ass.GetManifestResourceNames().Aggregate(new StringBuilder(), (sb, r) => sb.AppendLine(r)).ToString();
throw new DatabaseScriptException($"Could not find embedded resource '{resourceName}'. Available resources in assembly: {availableResources}");
}
using (var reader = new StreamReader(str))
{
return reader.ReadToEnd();
}
}
}