Ejemplo n.º 1
0
        public static async Task <string> GetSqlDataAsync()
        {
            ASCIIEncoding bytesConverter = new ASCIIEncoding();
            Assembly      assembly       = typeof(SqlEngineProvider).Assembly;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                foreach (string manifestResourceName in assembly.GetManifestResourceNames()
                         .Where(resource => resource.StartsWith(SqlResourceName, StringComparison.Ordinal))
                         .OrderBy(resource => resource))
                {
                    byte[] bytes = await ResourceStream.GetBinaryResourceAsync(manifestResourceName);

                    await memoryStream.WriteAsync(bytes, 0, bytes.Length);

                    await memoryStream.FlushAsync();
                }

                return(bytesConverter.GetString(memoryStream.ToArray()));
            }
        }
Ejemplo n.º 2
0
 public static async Task <string> GetImageInsertCommandAsync()
 {
     return(await ResourceStream.GetResourceStringAsync(SqlInsertImageResourceName));
 }