/// <summary> /// 保存实体变更 /// </summary> /// <param name="acceptAllChangesOnSuccess">成功后是否应用变更</param> /// <param name="isSoftDelete">是否使用软删除</param> /// <returns>受影响的行数</returns> public virtual int SaveChanges(bool acceptAllChangesOnSuccess = true, bool isSoftDelete = true) { this.SetSpecialPropertiesOfEntity(); var changes = _entityHistoryRecorder?.DiscoveryChanges(this); if (isSoftDelete) { this.SetSoftDelete(); } var i = base.SaveChanges(acceptAllChangesOnSuccess); _entityHistoryRecorder?.RecordHistory(changes, isSoftDelete); return(i); }