public string ListInformationTables(SqlMapWithDBOptionModel model)
        {
            var argument = $"-u " + model.HostName + " -D " + model.Database + " --tables --batch";

            processStartInfo.Arguments = argument;
            using (Process process = Process.Start(processStartInfo))
            {
                using (StreamReader reader = process.StandardOutput)
                {
                    string result = reader.ReadToEnd();
                    return(result);
                }
            }
        }
Пример #2
0
        public IActionResult ListInformationTables([FromQuery] SqlMapWithDBOptionModel model)
        {
            string fileName = OnkeiUtil.GenerateTimeStamp();
            var    result   = _sqlMapService.ListInformationTables(model);

            if (result == null)
            {
                return(BadRequest(
                           BaseResponseModel.PrepareDataFail("Model is not correct")
                           ));
            }
            string link = "http://" + HttpContext.Request.Host.Value + "/file/download/" + OnkeiUtil.SaveFile(fileName, result);

            return(Ok(BaseResponseModel.PrepareDataSuccess(result, "Success", link)));
        }