mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 MySql 特有功能 Insert Ignore Into;
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using FreeSql;
|
||||
using FreeSql.MySql.Curd;
|
||||
using System;
|
||||
|
||||
public static partial class FreeSqlMySqlGlobalExtensions
|
||||
{
|
||||
@ -22,4 +23,17 @@ public static partial class FreeSqlMySqlGlobalExtensions
|
||||
/// <returns></returns>
|
||||
public static OnDuplicateKeyUpdate<T1> OnDuplicateKeyUpdate<T1>(this IInsert<T1> that) where T1 : class => new FreeSql.MySql.Curd.OnDuplicateKeyUpdate<T1>(that.InsertIdentity());
|
||||
|
||||
/// <summary>
|
||||
/// MySql 特有的功能,Insert Ignore Into
|
||||
/// </summary>
|
||||
/// <typeparam name="T1"></typeparam>
|
||||
/// <param name="that"></param>
|
||||
/// <returns></returns>
|
||||
public static IInsert<T1> MySqlIgnoreInto<T1>(this IInsert<T1> that) where T1 : class
|
||||
{
|
||||
var _mysqlInsert = that as MySqlInsert<T1>;
|
||||
if (_mysqlInsert == null) throw new Exception("MySqlIgnoreInto 是 FreeSql.Provider.MySql/FreeSql.Provider.MySqlConnector 特有的功能");
|
||||
_mysqlInsert.InternalIsIgnoreInto = true;
|
||||
return that;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user