mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 DbContext/Repository 比较变化方法 CompareState;
This commit is contained in:
@ -127,6 +127,7 @@ namespace FreeSql
|
||||
return this;
|
||||
}
|
||||
public void FlushState() => _dbset.FlushState();
|
||||
public Dictionary<string, object[]> CompareState(TEntity newdata) => _dbset.CompareState(newdata);
|
||||
|
||||
public virtual TEntity InsertOrUpdate(TEntity entity)
|
||||
{
|
||||
|
@ -58,6 +58,12 @@ namespace FreeSql
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
IBaseRepository<TEntity> AttachOnlyPrimary(TEntity data);
|
||||
/// <summary>
|
||||
/// 比较实体,计算出值发生变化的属性,以及属性变化的前后值
|
||||
/// </summary>
|
||||
/// <param name="newdata">最新的实体对象,它将与附加实体的状态对比</param>
|
||||
/// <returns></returns>
|
||||
Dictionary<string, object[]> CompareState(TEntity newdata);
|
||||
|
||||
int Update(TEntity entity);
|
||||
int Update(IEnumerable<TEntity> entitys);
|
||||
|
Reference in New Issue
Block a user