diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/StaticConfig.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/StaticConfig.cs index c57078958..5cb438a76 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/StaticConfig.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/StaticConfig.cs @@ -16,6 +16,7 @@ namespace SqlSugar public const string CodeFirst_BigString = "varcharmax,longtext,text,clob"; public static string CodeFirst_MySqlCollate{get;set;} public static string CodeFirst_MySqlTableEngine { get; set; } + public static Type Backup_MySqlBackupType { get; set; } public static Func CustomSnowFlakeFunc; public static Func CustomSnowFlakeTimeErrorFunc; diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs b/Src/Asp.NetCore2/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs index 1343aab64..ff9e07ffe 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs @@ -713,9 +713,16 @@ WHERE EVENT_OBJECT_TABLE = '" + tableName + "'"); try { - Assembly currentAssembly = Assembly.GetExecutingAssembly(); - string exePath = currentAssembly.Location.Replace("SqlSugar.dll", "MySqlBackupNet.MySqlConnector.dll"); - assembly = Assembly.LoadFrom(exePath); + if (StaticConfig.Backup_MySqlBackupType != null) + { + assembly = StaticConfig.Backup_MySqlBackupType.Assembly; + } + else + { + Assembly currentAssembly = Assembly.GetExecutingAssembly(); + string exePath = currentAssembly.Location.Replace("SqlSugar.dll", "MySqlBackupNet.MySqlConnector.dll"); + assembly = Assembly.LoadFrom(exePath); + } } catch (Exception) {