예제 #1
0
        private async Task <Dictionary <string, string> > GetAllAsync()
        {
            var result     = new Dictionary <string, string>();
            var assemblies = DIResolver.GetAssemblies();

            foreach (var assembly in assemblies)
            {
                var resourceNames = assembly.GetManifestResourceNames();
                foreach (var resourceName in resourceNames)
                {
                    var resourceStream = assembly.GetManifestResourceStream(resourceName);
                    if (resourceStream == null)
                    {
                        continue;
                    }

                    using (var reader = new System.IO.StreamReader(resourceStream, Encoding.UTF8))
                    {
                        var sql = await reader.ReadToEndAsync();

                        result.Add(resourceName, sql);
                    }
                }
            }
            return(result);
        }