From a3ecd211629b842fd2f1a78e26a3b97cfaae359b Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Thu, 19 Jan 2023 13:25:27 +0800 Subject: [PATCH] Synchronization code --- .../Realization/Dm/DbMaintenance/DmDbMaintenance.cs | 7 ++++++- .../Oracle/DbMaintenance/OracleDbMaintenance.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DbMaintenance/DmDbMaintenance.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DbMaintenance/DmDbMaintenance.cs index 904ef15f4..38acaa554 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DbMaintenance/DmDbMaintenance.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Dm/DbMaintenance/DmDbMaintenance.cs @@ -305,7 +305,12 @@ namespace SqlSugar } public override bool CreateDatabase(string databaseName, string databaseDirectory = null) { - throw new NotSupportedException(); + if (this.Context.Ado.IsValidConnection()) + { + return true; + } + Check.ExceptionEasy("dm no support create database ", "达梦不支持建库方法,请写有效连接字符串可以正常运行该方法。"); + return true; } public override bool AddRemark(EntityInfo entity) { diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs index 0ff084b6a..81f20419e 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs @@ -307,7 +307,12 @@ namespace SqlSugar } public override bool CreateDatabase(string databaseDirectory = null) { - throw new NotSupportedException(); + if (this.Context.Ado.IsValidConnection()) + { + return true; + } + Check.ExceptionEasy("Oracle no support create database ", "Oracle不支持建库方法,请写有效连接字符串可以正常运行该方法。"); + return true; } public override bool CreateDatabase(string databaseName, string databaseDirectory = null) {