public string ListInformationColumnsOfTable(SqlMapWithDBAndTableOptionModel model) { var argument = $"-u " + model.HostName + " -D " + model.Database + " -T " + model.TableName + " --columns --batch"; processStartInfo.Arguments = argument; using (Process process = Process.Start(processStartInfo)) { using (StreamReader reader = process.StandardOutput) { string result = reader.ReadToEnd(); return(result); } } }
public IActionResult ListInformationColumnsOfTable([FromQuery] SqlMapWithDBAndTableOptionModel model) { string fileName = OnkeiUtil.GenerateTimeStamp(); var result = _sqlMapService.ListInformationColumnsOfTable(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))); }