This commit is contained in:
2881099
2021-03-04 15:29:26 +08:00
parent 90438e20d8
commit a1a120495b
28 changed files with 36 additions and 39 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
<Version>2.3.105</Version>
<Version>2.3.106</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>FreeSql;ncc;YeXiangQin</Authors>
<Description>FreeSql is the ORM in .NetCore, .NetFramework, And Xamarin. It supports Mysql, Postgresql, SqlServer, Oracle, Sqlite, Firebird, Odbc, 达梦, 人大金仓, 神舟通用, 翰高, And Access</Description>

View File

@ -2732,7 +2732,7 @@
注意:实体必须定义主键,并且最终会自动附加条件 where id in (source.Id)
</summary>
<param name="source">实体集合</param>
<param name="primarys">根据主键更新a => a.Name | a => new{a.Name,a.Time} | a => new[]{"name","time"}</param>
<param name="tempPrimarys">根据临时主键更新a => a.Name | a => new{a.Name,a.Time} | a => new[]{"name","time"}</param>
<returns></returns>
</member>
<member name="M:FreeSql.IUpdate`1.SetSourceIgnore(`0,System.Func{System.Object,System.Boolean})">

View File

@ -72,9 +72,9 @@ namespace FreeSql
/// 注意:实体必须定义主键,并且最终会自动附加条件 where id in (source.Id)
/// </summary>
/// <param name="source">实体集合</param>
/// <param name="primarys">根据主键更新a => a.Name | a => new{a.Name,a.Time} | a => new[]{"name","time"}</param>
/// <param name="tempPrimarys">根据临时主键更新a => a.Name | a => new{a.Name,a.Time} | a => new[]{"name","time"}</param>
/// <returns></returns>
IUpdate<T1> SetSource(IEnumerable<T1> source, Expression<Func<T1, object>> primarys = null);
IUpdate<T1> SetSource(IEnumerable<T1> source, Expression<Func<T1, object>> tempPrimarys = null);
/// <summary>
/// 更新数据,设置更新的实体,同时设置忽略的列<para></para>
/// 忽略 null 属性fsql.Update&lt;T&gt;().SetSourceAndIgnore(item, colval => colval == null)<para></para>

View File

@ -669,6 +669,7 @@ namespace FreeSql.Internal.CommonProvider
if (entityType == _table.Type) return this;
var newtb = _commonUtils.GetTableByEntity(entityType);
_table = newtb ?? throw new Exception("IUpdate.AsType 参数错误,请传入正确的实体类型");
_tempPrimarys = _table.Primarys;
if (_orm.CodeFirst.IsAutoSyncStructure) _orm.CodeFirst.SyncStructure(entityType);
IgnoreCanUpdate();
return this;