- 增加 MySql 特有功能 On Duplicate Key Update 功能;

This commit is contained in:
28810
2019-11-11 22:08:21 +08:00
parent f2cb3bd5fe
commit be77060ea8
11 changed files with 619 additions and 7 deletions

View File

@ -1,4 +1,7 @@
public static partial class FreeSqlMySqlGlobalExtensions
using FreeSql;
using FreeSql.MySql.Curd;
public static partial class FreeSqlMySqlGlobalExtensions
{
/// <summary>
@ -9,4 +12,14 @@
/// <returns></returns>
public static string FormatMySql(this string that, params object[] args) => _mysqlAdo.Addslashes(that, args);
static FreeSql.MySql.MySqlAdo _mysqlAdo = new FreeSql.MySql.MySqlAdo();
/// <summary>
/// MySql 特有的功能On Duplicate Key Update<para></para>
/// 注意:此功能会开启插入【自增列】
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <param name="that"></param>
/// <returns></returns>
public static OnDuplicateKeyUpdate<T1> OnDuplicateKeyUpdate<T1>(this IInsert<T1> that) where T1 : class => new FreeSql.MySql.Curd.OnDuplicateKeyUpdate<T1>(that.InsertIdentity());
}