mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 增加 IInsertOrUpdate SetSource 重载方法;
This commit is contained in:
parent
d55e6782d4
commit
ea17bf3e70
@ -36,6 +36,16 @@ namespace FreeSql
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IInsertOrUpdate<T1> SetSource(T1 source);
|
IInsertOrUpdate<T1> SetSource(T1 source);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 添加或更新,设置实体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="source">实体</param>
|
||||||
|
/// <param name="tempPrimarys">
|
||||||
|
/// 根据临时主键插入或更新,a => a.Name | a => new{a.Name,a.Time} | a => new[]{"name","time"}<para></para>
|
||||||
|
/// 注意:不处理自增,因某些数据库依赖主键或唯一键,所以指定临时主键仅对 SqlServer/PostgreSQL/Firebird/达梦/南大通用/金仓/神通 有效
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IInsertOrUpdate<T1> SetSource(T1 source, Expression<Func<T1, object>> tempPrimarys);
|
||||||
|
/// <summary>
|
||||||
/// 添加或更新,设置实体集合
|
/// 添加或更新,设置实体集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="source">实体集合</param>
|
/// <param name="source">实体集合</param>
|
||||||
|
@ -118,6 +118,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IInsertOrUpdate<T1> SetSource(T1 source) => this.SetSource(new[] { source });
|
public IInsertOrUpdate<T1> SetSource(T1 source) => this.SetSource(new[] { source });
|
||||||
|
public IInsertOrUpdate<T1> SetSource(T1 source, Expression<Func<T1, object>> tempPrimarys) => this.SetSource(new[] { source }, tempPrimarys);
|
||||||
public IInsertOrUpdate<T1> SetSource(IEnumerable<T1> source, Expression<Func<T1, object>> tempPrimarys = null)
|
public IInsertOrUpdate<T1> SetSource(IEnumerable<T1> source, Expression<Func<T1, object>> tempPrimarys = null)
|
||||||
{
|
{
|
||||||
if (source == null || source.Any() == false) return this;
|
if (source == null || source.Any() == false) return this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user