コード例 #1
0
        private QueryResult ExecuteQuery(string fileName)
        {
            if (!File.Exists(fileName))
            {
                return(new QueryResult());
            }

            var newQuery  = File.ReadAllText(fileName).Trim();
            var newResult = query.ExecuteQuery(newQuery);

            return(new QueryResult {
                Query = newQuery, Result = newResult
            });
        }
コード例 #2
0
        private string RunQueryAndGetPath(string fileName)
        {
            if (!File.Exists(fileName))
            {
                return(fileName);
            }

            var newQuery    = File.ReadAllText(fileName).Trim();
            var newResult   = query.ExecuteQuery(newQuery);
            var newFileName = fileName + FILE_ADDITION;
            var header      = "\t\tDo NOT approve\r\n\t\tThis File will be Deleted\r\n\t\tit is for feedback purposes only\r\n";

            File.WriteAllText(newFileName, string.Format("{0}query:\r\n\r\n{1}\r\n\r\nresult:\r\n\r\n{2}", header, newQuery, newResult));
            return(newFileName);
        }