- 移除 Repository SaveMany;

This commit is contained in:
2881099
2024-07-24 21:21:30 +08:00
parent 3e3fcf9580
commit b024c54d01
14 changed files with 124 additions and 394 deletions

View File

@ -183,20 +183,6 @@ namespace FreeSql
CheckEntityTypeOrThrow(typeof(TEntity));
this.Set<TEntity>().AddOrUpdate(data);
}
/// <summary>
/// 保存实体的指定 ManyToMany/OneToMany 导航属性(完整对比)<para></para>
/// 场景:在关闭级联保存功能之后,手工使用本方法<para></para>
/// 例子:保存商品的 OneToMany 集合属性SaveMany(goods, "Skus")<para></para>
/// 当 goods.Skus 为空(非null)时,会删除表中已存在的所有数据<para></para>
/// 当 goods.Skus 不为空(非null)时,添加/更新后,删除表中不存在 Skus 集合属性的所有记录
/// </summary>
/// <param name="data">实体对象</param>
/// <param name="propertyName">属性名</param>
public void SaveMany<TEntity>(TEntity data, string propertyName) where TEntity : class
{
CheckEntityTypeOrThrow(typeof(TEntity));
this.Set<TEntity>().SaveMany(data, propertyName);
}
/// <summary>
/// 附加实体,可用于不查询就更新或删除
@ -253,11 +239,6 @@ namespace FreeSql
CheckEntityTypeOrThrow(typeof(TEntity));
return this.Set<TEntity>().AddOrUpdateAsync(data, cancellationToken);
}
public Task SaveManyAsync<TEntity>(TEntity data, string propertyName, CancellationToken cancellationToken = default) where TEntity : class
{
CheckEntityTypeOrThrow(typeof(TEntity));
return this.Set<TEntity>().SaveManyAsync(data, propertyName, cancellationToken);
}
#endif
#endregion

View File

@ -24,16 +24,6 @@ namespace FreeSql
/// </summary>
public bool EnableCascadeSave { get; set; } = false;
/// <summary>
/// 因增加支持 OneToOne 级联保存,和基于内存的级联删除,已改名为 EnableCascadeSave
/// </summary>
[Obsolete("因增加支持 OneToOne 级联保存,和基于内存的级联删除,已改名为 EnableCascadeSave")]
public bool EnableAddOrUpdateNavigateList
{
get => EnableCascadeSave;
set => EnableCascadeSave = value;
}
/// <summary>
/// 使用无参数化设置(对应 IInsert/IUpdate
/// </summary>