Ejemplo n.º 1
0
        private SqlScript ReadResourceAsScript(string scriptName)
        {
            string contents;
            var    resourceStream = assembly.GetManifestResourceStream(scriptName);

            using (var resourceStreamReader = new StreamReader(resourceStream))
            {
                contents = resourceStreamReader.ReadToEnd();
            }

            return(new SqlScript(scriptName, contents));
        }
Ejemplo n.º 2
0
 public string GetContent(string path)
 {
     try
     {
         var stream = _ResourcesAssembly.GetManifestResourceStream(GetResourcePath(path));
         if (stream != null)
         {
             using (StreamReader reader = new StreamReader(stream))
             {
                 return(reader.ReadToEnd());
             }
         }
     }
     catch { }
     return(null);
 }