Ejemplo n.º 1
0
        public void ScriptObject(View view, Options options)
        {
            StringCollection script   = view.Script(_scriptingOptions);
            string           path     = _directoryService.GetViewsDirectory(options.Root);
            string           fileName = Path.Combine(path, string.Concat(view.Name, ".sql"));

            _fileWriter.WriteFile(fileName, script.Cast <string>());
        }
Ejemplo n.º 2
0
        public void CreateViews(Options options)
        {
            string directory = _directoryService.GetViewsDirectory(options.Root);

            if (!Directory.Exists(directory))
            {
                throw new Exception(string.Format("Directory '{0}' does not exist", directory));
            }

            for (int x = 0; x < 2; x++)
            {
                IEnumerable <string> files = Directory.GetFiles(directory);
                ProcessDirectoryFiles(files, options);
            }
        }