mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 MySql 特有功能 On Duplicate Key Update 功能;
This commit is contained in:
@ -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());
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user